{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('examples/ex1.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d message\n",
       "0  1   2   3   4   hello\n",
       "1  5   6   7   8   world\n",
       "2  9  10  11  12     foo"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d message\n",
       "0  1   2   3   4   hello\n",
       "1  5   6   7   8   world\n",
       "2  9  10  11  12     foo"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_table('examples/ex1.csv',sep=',')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   0   1   2   3      4\n",
       "0  1   2   3   4  hello\n",
       "1  5   6   7   8  world\n",
       "2  9  10  11  12    foo"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_csv('examples/ex2.csv', header=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d message\n",
       "0  1   2   3   4   hello\n",
       "1  5   6   7   8   world\n",
       "2  9  10  11  12     foo"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_csv('examples/ex2.csv', names = ['a','b','c','d','message'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>message</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>hello</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>world</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>foo</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         a   b   c   d\n",
       "message               \n",
       "hello    1   2   3   4\n",
       "world    5   6   7   8\n",
       "foo      9  10  11  12"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_csv('examples/ex2.csv', names = ['a','b','c','d','message'],index_col='message')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "parsed = pd.read_csv('examples/csv_mindex.csv',index_col=['key1','key2'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>value1</th>\n",
       "      <th>value2</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>key1</th>\n",
       "      <th>key2</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">one</th>\n",
       "      <th>a</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">two</th>\n",
       "      <th>a</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>13</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>15</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           value1  value2\n",
       "key1 key2                \n",
       "one  a          1       2\n",
       "     b          3       4\n",
       "     c          5       6\n",
       "     d          7       8\n",
       "two  a          9      10\n",
       "     b         11      12\n",
       "     c         13      14\n",
       "     d         15      16"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "parsed"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[' A B C\\n',\n",
       " ' aaa -0.264438 -1.026059 -0.619500\\n',\n",
       " ' bbb 0.927272 0.302904 -0.032399\\n',\n",
       " ' ccc -0.264273 -0.386314 -0.217601\\n',\n",
       " ' ddd -0.871858 -0.348382 1.100491\\n',\n",
       " '\\n']"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(open('examples/ex3.txt'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = pd.read_table('examples/ex3.txt',sep=r'\\s+')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>aaa</th>\n",
       "      <td>-0.264438</td>\n",
       "      <td>-1.026059</td>\n",
       "      <td>-0.619500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>bbb</th>\n",
       "      <td>0.927272</td>\n",
       "      <td>0.302904</td>\n",
       "      <td>-0.032399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ccc</th>\n",
       "      <td>-0.264273</td>\n",
       "      <td>-0.386314</td>\n",
       "      <td>-0.217601</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ddd</th>\n",
       "      <td>-0.871858</td>\n",
       "      <td>-0.348382</td>\n",
       "      <td>1.100491</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            A         B         C\n",
       "aaa -0.264438 -1.026059 -0.619500\n",
       "bbb  0.927272  0.302904 -0.032399\n",
       "ccc -0.264273 -0.386314 -0.217601\n",
       "ddd -0.871858 -0.348382  1.100491"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d message\n",
       "0  1   2   3   4   hello\n",
       "1  5   6   7   8   world\n",
       "2  9  10  11  12     foo"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_csv('examples/ex4.csv', skiprows=[0,2,3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = pd.read_csv('examples/ex5.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>something</th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>one</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>two</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>three</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11.0</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  something  a   b     c   d message\n",
       "0       one  1   2   3.0   4     NaN\n",
       "1       two  5   6   NaN   8   world\n",
       "2     three  9  10  11.0  12     foo"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>something</th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   something      a      b      c      d  message\n",
       "0      False  False  False  False  False     True\n",
       "1      False  False  False   True  False    False\n",
       "2      False  False  False  False  False    False"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.isnull()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = pd.read_csv('examples/ex5.csv',na_values=['1'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>something</th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>one</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>two</td>\n",
       "      <td>5.0</td>\n",
       "      <td>6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>three</td>\n",
       "      <td>9.0</td>\n",
       "      <td>10</td>\n",
       "      <td>11.0</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  something    a   b     c   d message\n",
       "0       one  NaN   2   3.0   4     NaN\n",
       "1       two  5.0   6   NaN   8   world\n",
       "2     three  9.0  10  11.0  12     foo"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "sentinels = {'message': ['foo', 'NA'], 'something': ['two']}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = pd.read_csv('examples/ex5.csv',na_values=sentinels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>something</th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>one</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>three</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11.0</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  something  a   b     c   d message\n",
       "0       one  1   2   3.0   4     NaN\n",
       "1       NaN  5   6   NaN   8   world\n",
       "2     three  9  10  11.0  12     NaN"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = np.random.randn(10000,4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "ex6 = pd.DataFrame(data=data,columns=['one','two','three','four'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.random.randint?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "from random import choices"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [],
   "source": [
    "from string import ascii_uppercase"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [],
   "source": [
    "key = choices(list(ascii_uppercase),k=10000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['V',\n",
       " 'M',\n",
       " 'T',\n",
       " 'Q',\n",
       " 'V',\n",
       " 'Y',\n",
       " 'M',\n",
       " 'N',\n",
       " 'Z',\n",
       " 'A',\n",
       " 'M',\n",
       " 'F',\n",
       " 'I',\n",
       " 'H',\n",
       " 'E',\n",
       " 'E',\n",
       " 'H',\n",
       " 'L',\n",
       " 'L',\n",
       " 'U',\n",
       " 'U',\n",
       " 'U',\n",
       " 'O',\n",
       " 'J',\n",
       " 'B',\n",
       " 'P',\n",
       " 'Q',\n",
       " 'N',\n",
       " 'X',\n",
       " 'F',\n",
       " 'B',\n",
       " 'D',\n",
       " 'F',\n",
       " 'C',\n",
       " 'Z',\n",
       " 'C',\n",
       " 'Y',\n",
       " 'Y',\n",
       " 'V',\n",
       " 'F',\n",
       " 'K',\n",
       " 'G',\n",
       " 'Z',\n",
       " 'U',\n",
       " 'Q',\n",
       " 'O',\n",
       " 'C',\n",
       " 'P',\n",
       " 'C',\n",
       " 'Q',\n",
       " 'N',\n",
       " 'J',\n",
       " 'J',\n",
       " 'F',\n",
       " 'L',\n",
       " 'M',\n",
       " 'Y',\n",
       " 'E',\n",
       " 'B',\n",
       " 'A',\n",
       " 'U',\n",
       " 'Z',\n",
       " 'S',\n",
       " 'Q',\n",
       " 'Z',\n",
       " 'Q',\n",
       " 'G',\n",
       " 'T',\n",
       " 'B',\n",
       " 'H',\n",
       " 'Z',\n",
       " 'W',\n",
       " 'Y',\n",
       " 'H',\n",
       " 'U',\n",
       " 'R',\n",
       " 'O',\n",
       " 'A',\n",
       " 'O',\n",
       " 'E',\n",
       " 'V',\n",
       " 'G',\n",
       " 'A',\n",
       " 'O',\n",
       " 'R',\n",
       " 'K',\n",
       " 'Q',\n",
       " 'G',\n",
       " 'J',\n",
       " 'U',\n",
       " 'O',\n",
       " 'V',\n",
       " 'O',\n",
       " 'R',\n",
       " 'J',\n",
       " 'D',\n",
       " 'P',\n",
       " 'Z',\n",
       " 'H',\n",
       " 'R',\n",
       " 'J',\n",
       " 'U',\n",
       " 'B',\n",
       " 'W',\n",
       " 'P',\n",
       " 'F',\n",
       " 'G',\n",
       " 'K',\n",
       " 'L',\n",
       " 'E',\n",
       " 'Z',\n",
       " 'J',\n",
       " 'N',\n",
       " 'J',\n",
       " 'I',\n",
       " 'B',\n",
       " 'U',\n",
       " 'T',\n",
       " 'B',\n",
       " 'Y',\n",
       " 'E',\n",
       " 'T',\n",
       " 'P',\n",
       " 'O',\n",
       " 'S',\n",
       " 'Y',\n",
       " 'B',\n",
       " 'F',\n",
       " 'U',\n",
       " 'W',\n",
       " 'S',\n",
       " 'T',\n",
       " 'R',\n",
       " 'V',\n",
       " 'P',\n",
       " 'S',\n",
       " 'S',\n",
       " 'M',\n",
       " 'B',\n",
       " 'Q',\n",
       " 'M',\n",
       " 'Z',\n",
       " 'Q',\n",
       " 'A',\n",
       " 'J',\n",
       " 'M',\n",
       " 'Q',\n",
       " 'B',\n",
       " 'S',\n",
       " 'K',\n",
       " 'Y',\n",
       " 'S',\n",
       " 'X',\n",
       " 'J',\n",
       " 'I',\n",
       " 'F',\n",
       " 'G',\n",
       " 'A',\n",
       " 'T',\n",
       " 'M',\n",
       " 'K',\n",
       " 'C',\n",
       " 'Z',\n",
       " 'T',\n",
       " 'Y',\n",
       " 'F',\n",
       " 'R',\n",
       " 'V',\n",
       " 'C',\n",
       " 'M',\n",
       " 'V',\n",
       " 'N',\n",
       " 'X',\n",
       " 'A',\n",
       " 'T',\n",
       " 'K',\n",
       " 'O',\n",
       " 'J',\n",
       " 'W',\n",
       " 'X',\n",
       " 'A',\n",
       " 'J',\n",
       " 'U',\n",
       " 'N',\n",
       " 'S',\n",
       " 'N',\n",
       " 'M',\n",
       " 'Y',\n",
       " 'B',\n",
       " 'L',\n",
       " 'Q',\n",
       " 'O',\n",
       " 'N',\n",
       " 'Y',\n",
       " 'F',\n",
       " 'K',\n",
       " 'C',\n",
       " 'E',\n",
       " 'C',\n",
       " 'N',\n",
       " 'A',\n",
       " 'V',\n",
       " 'I',\n",
       " 'G',\n",
       " 'S',\n",
       " 'S',\n",
       " 'E',\n",
       " 'C',\n",
       " 'A',\n",
       " 'M',\n",
       " 'C',\n",
       " 'P',\n",
       " 'E',\n",
       " 'Y',\n",
       " 'T',\n",
       " 'L',\n",
       " 'F',\n",
       " 'A',\n",
       " 'C',\n",
       " 'G',\n",
       " 'Z',\n",
       " 'N',\n",
       " 'R',\n",
       " 'Y',\n",
       " 'U',\n",
       " 'F',\n",
       " 'J',\n",
       " 'J',\n",
       " 'I',\n",
       " 'W',\n",
       " 'H',\n",
       " 'J',\n",
       " 'T',\n",
       " 'Q',\n",
       " 'C',\n",
       " 'V',\n",
       " 'S',\n",
       " 'B',\n",
       " 'N',\n",
       " 'J',\n",
       " 'X',\n",
       " 'M',\n",
       " 'P',\n",
       " 'A',\n",
       " 'U',\n",
       " 'I',\n",
       " 'I',\n",
       " 'T',\n",
       " 'B',\n",
       " 'X',\n",
       " 'Y',\n",
       " 'Z',\n",
       " 'H',\n",
       " 'J',\n",
       " 'E',\n",
       " 'M',\n",
       " 'B',\n",
       " 'I',\n",
       " 'C',\n",
       " 'Q',\n",
       " 'M',\n",
       " 'O',\n",
       " 'X',\n",
       " 'T',\n",
       " 'E',\n",
       " 'P',\n",
       " 'V',\n",
       " 'X',\n",
       " 'U',\n",
       " 'D',\n",
       " 'A',\n",
       " 'Q',\n",
       " 'J',\n",
       " 'O',\n",
       " 'K',\n",
       " 'Z',\n",
       " 'Y',\n",
       " 'F',\n",
       " 'S',\n",
       " 'U',\n",
       " 'X',\n",
       " 'P',\n",
       " 'W',\n",
       " 'M',\n",
       " 'W',\n",
       " 'S',\n",
       " 'P',\n",
       " 'J',\n",
       " 'V',\n",
       " 'Y',\n",
       " 'C',\n",
       " 'B',\n",
       " 'T',\n",
       " 'J',\n",
       " 'T',\n",
       " 'N',\n",
       " 'C',\n",
       " 'G',\n",
       " 'O',\n",
       " 'Z',\n",
       " 'T',\n",
       " 'Y',\n",
       " 'T',\n",
       " 'Y',\n",
       " 'Z',\n",
       " 'X',\n",
       " 'Y',\n",
       " 'O',\n",
       " 'V',\n",
       " 'C',\n",
       " 'V',\n",
       " 'I',\n",
       " 'P',\n",
       " 'F',\n",
       " 'O',\n",
       " 'Y',\n",
       " 'E',\n",
       " 'J',\n",
       " 'T',\n",
       " 'G',\n",
       " 'D',\n",
       " 'R',\n",
       " 'I',\n",
       " 'E',\n",
       " 'Q',\n",
       " 'H',\n",
       " 'R',\n",
       " 'X',\n",
       " 'U',\n",
       " 'F',\n",
       " 'M',\n",
       " 'P',\n",
       " 'D',\n",
       " 'V',\n",
       " 'W',\n",
       " 'L',\n",
       " 'F',\n",
       " 'Q',\n",
       " 'A',\n",
       " 'A',\n",
       " 'E',\n",
       " 'E',\n",
       " 'I',\n",
       " 'O',\n",
       " 'R',\n",
       " 'A',\n",
       " 'V',\n",
       " 'Z',\n",
       " 'F',\n",
       " 'W',\n",
       " 'G',\n",
       " 'T',\n",
       " 'N',\n",
       " 'I',\n",
       " 'F',\n",
       " 'P',\n",
       " 'C',\n",
       " 'U',\n",
       " 'P',\n",
       " 'T',\n",
       " 'U',\n",
       " 'C',\n",
       " 'W',\n",
       " 'C',\n",
       " 'T',\n",
       " 'T',\n",
       " 'S',\n",
       " 'I',\n",
       " 'L',\n",
       " 'K',\n",
       " 'B',\n",
       " 'O',\n",
       " 'F',\n",
       " 'Z',\n",
       " 'Y',\n",
       " 'D',\n",
       " 'I',\n",
       " 'E',\n",
       " 'O',\n",
       " 'M',\n",
       " 'P',\n",
       " 'M',\n",
       " 'W',\n",
       " 'K',\n",
       " 'K',\n",
       " 'E',\n",
       " 'S',\n",
       " 'G',\n",
       " 'E',\n",
       " 'O',\n",
       " 'R',\n",
       " 'D',\n",
       " 'F',\n",
       " 'P',\n",
       " 'V',\n",
       " 'U',\n",
       " 'N',\n",
       " 'Z',\n",
       " 'K',\n",
       " 'U',\n",
       " 'Z',\n",
       " 'O',\n",
       " 'K',\n",
       " 'I',\n",
       " 'D',\n",
       " 'A',\n",
       " 'N',\n",
       " 'L',\n",
       " 'I',\n",
       " 'N',\n",
       " 'T',\n",
       " 'A',\n",
       " 'I',\n",
       " 'Y',\n",
       " 'T',\n",
       " 'U',\n",
       " 'I',\n",
       " 'H',\n",
       " 'S',\n",
       " 'C',\n",
       " 'D',\n",
       " 'K',\n",
       " 'E',\n",
       " 'C',\n",
       " 'A',\n",
       " 'A',\n",
       " 'F',\n",
       " 'B',\n",
       " 'Z',\n",
       " 'X',\n",
       " 'D',\n",
       " 'K',\n",
       " 'G',\n",
       " 'E',\n",
       " 'B',\n",
       " 'N',\n",
       " 'S',\n",
       " 'V',\n",
       " 'B',\n",
       " 'K',\n",
       " 'X',\n",
       " 'I',\n",
       " 'C',\n",
       " 'Q',\n",
       " 'I',\n",
       " 'I',\n",
       " 'Z',\n",
       " 'U',\n",
       " 'W',\n",
       " 'G',\n",
       " 'Q',\n",
       " 'B',\n",
       " 'U',\n",
       " 'N',\n",
       " 'A',\n",
       " 'S',\n",
       " 'D',\n",
       " 'Z',\n",
       " 'O',\n",
       " 'F',\n",
       " 'R',\n",
       " 'W',\n",
       " 'K',\n",
       " 'X',\n",
       " 'D',\n",
       " 'R',\n",
       " 'X',\n",
       " 'M',\n",
       " 'Y',\n",
       " 'L',\n",
       " 'S',\n",
       " 'Y',\n",
       " 'V',\n",
       " 'A',\n",
       " 'K',\n",
       " 'B',\n",
       " 'H',\n",
       " 'W',\n",
       " 'U',\n",
       " 'H',\n",
       " 'P',\n",
       " 'Y',\n",
       " 'Y',\n",
       " 'Z',\n",
       " 'I',\n",
       " 'W',\n",
       " 'P',\n",
       " 'A',\n",
       " 'K',\n",
       " 'R',\n",
       " 'U',\n",
       " 'U',\n",
       " 'X',\n",
       " 'R',\n",
       " 'C',\n",
       " 'C',\n",
       " 'J',\n",
       " 'P',\n",
       " 'C',\n",
       " 'M',\n",
       " 'L',\n",
       " 'U',\n",
       " 'M',\n",
       " 'A',\n",
       " 'K',\n",
       " 'E',\n",
       " 'F',\n",
       " 'I',\n",
       " 'K',\n",
       " 'D',\n",
       " 'G',\n",
       " 'C',\n",
       " 'Z',\n",
       " 'S',\n",
       " 'V',\n",
       " 'L',\n",
       " 'K',\n",
       " 'N',\n",
       " 'K',\n",
       " 'Q',\n",
       " 'O',\n",
       " 'D',\n",
       " 'U',\n",
       " 'K',\n",
       " 'A',\n",
       " 'J',\n",
       " 'X',\n",
       " 'A',\n",
       " 'I',\n",
       " 'I',\n",
       " 'T',\n",
       " 'S',\n",
       " 'E',\n",
       " 'S',\n",
       " 'Q',\n",
       " 'Q',\n",
       " 'H',\n",
       " 'E',\n",
       " 'Z',\n",
       " 'A',\n",
       " 'C',\n",
       " 'R',\n",
       " 'T',\n",
       " 'I',\n",
       " 'T',\n",
       " 'U',\n",
       " 'C',\n",
       " 'W',\n",
       " 'H',\n",
       " 'M',\n",
       " 'O',\n",
       " 'K',\n",
       " 'G',\n",
       " 'A',\n",
       " 'X',\n",
       " 'P',\n",
       " 'M',\n",
       " 'A',\n",
       " 'B',\n",
       " 'C',\n",
       " 'K',\n",
       " 'Q',\n",
       " 'G',\n",
       " 'B',\n",
       " 'R',\n",
       " 'L',\n",
       " 'E',\n",
       " 'C',\n",
       " 'E',\n",
       " 'K',\n",
       " 'E',\n",
       " 'M',\n",
       " 'L',\n",
       " 'K',\n",
       " 'K',\n",
       " 'K',\n",
       " 'J',\n",
       " 'E',\n",
       " 'K',\n",
       " 'A',\n",
       " 'X',\n",
       " 'P',\n",
       " 'I',\n",
       " 'S',\n",
       " 'E',\n",
       " 'L',\n",
       " 'R',\n",
       " 'C',\n",
       " 'O',\n",
       " 'I',\n",
       " 'C',\n",
       " 'Q',\n",
       " 'T',\n",
       " 'M',\n",
       " 'N',\n",
       " 'E',\n",
       " 'Q',\n",
       " 'U',\n",
       " 'X',\n",
       " 'L',\n",
       " 'M',\n",
       " 'I',\n",
       " 'O',\n",
       " 'K',\n",
       " 'N',\n",
       " 'Z',\n",
       " 'S',\n",
       " 'S',\n",
       " 'H',\n",
       " 'A',\n",
       " 'U',\n",
       " 'J',\n",
       " 'G',\n",
       " 'H',\n",
       " 'Q',\n",
       " 'Q',\n",
       " 'C',\n",
       " 'H',\n",
       " 'R',\n",
       " 'J',\n",
       " 'X',\n",
       " 'Z',\n",
       " 'M',\n",
       " 'T',\n",
       " 'N',\n",
       " 'N',\n",
       " 'Y',\n",
       " 'L',\n",
       " 'V',\n",
       " 'D',\n",
       " 'V',\n",
       " 'L',\n",
       " 'R',\n",
       " 'A',\n",
       " 'N',\n",
       " 'R',\n",
       " 'C',\n",
       " 'B',\n",
       " 'Z',\n",
       " 'U',\n",
       " 'A',\n",
       " 'C',\n",
       " 'P',\n",
       " 'S',\n",
       " 'N',\n",
       " 'P',\n",
       " 'P',\n",
       " 'E',\n",
       " 'U',\n",
       " 'W',\n",
       " 'O',\n",
       " 'U',\n",
       " 'V',\n",
       " 'Z',\n",
       " 'V',\n",
       " 'F',\n",
       " 'Q',\n",
       " 'P',\n",
       " 'G',\n",
       " 'R',\n",
       " 'W',\n",
       " 'E',\n",
       " 'K',\n",
       " 'P',\n",
       " 'C',\n",
       " 'Y',\n",
       " 'A',\n",
       " 'V',\n",
       " 'U',\n",
       " 'R',\n",
       " 'Z',\n",
       " 'C',\n",
       " 'C',\n",
       " 'W',\n",
       " 'D',\n",
       " 'H',\n",
       " 'X',\n",
       " 'U',\n",
       " 'Z',\n",
       " 'G',\n",
       " 'V',\n",
       " 'U',\n",
       " 'L',\n",
       " 'V',\n",
       " 'M',\n",
       " 'B',\n",
       " 'Y',\n",
       " 'V',\n",
       " 'A',\n",
       " 'B',\n",
       " 'A',\n",
       " 'O',\n",
       " 'S',\n",
       " 'Z',\n",
       " 'D',\n",
       " 'D',\n",
       " 'C',\n",
       " 'O',\n",
       " 'I',\n",
       " 'E',\n",
       " 'C',\n",
       " 'M',\n",
       " 'T',\n",
       " 'Y',\n",
       " 'U',\n",
       " 'L',\n",
       " 'S',\n",
       " 'E',\n",
       " 'L',\n",
       " 'A',\n",
       " 'K',\n",
       " 'V',\n",
       " 'F',\n",
       " 'A',\n",
       " 'G',\n",
       " 'C',\n",
       " 'M',\n",
       " 'S',\n",
       " 'K',\n",
       " 'E',\n",
       " 'E',\n",
       " 'F',\n",
       " 'F',\n",
       " 'V',\n",
       " 'I',\n",
       " 'M',\n",
       " 'R',\n",
       " 'E',\n",
       " 'E',\n",
       " 'Z',\n",
       " 'N',\n",
       " 'E',\n",
       " 'V',\n",
       " 'Y',\n",
       " 'Y',\n",
       " 'S',\n",
       " 'H',\n",
       " 'B',\n",
       " 'Q',\n",
       " 'K',\n",
       " 'Y',\n",
       " 'A',\n",
       " 'T',\n",
       " 'I',\n",
       " 'M',\n",
       " 'E',\n",
       " 'F',\n",
       " 'I',\n",
       " 'G',\n",
       " 'O',\n",
       " 'W',\n",
       " 'O',\n",
       " 'J',\n",
       " 'J',\n",
       " 'K',\n",
       " 'A',\n",
       " 'T',\n",
       " 'S',\n",
       " 'B',\n",
       " 'T',\n",
       " 'G',\n",
       " 'E',\n",
       " 'T',\n",
       " 'D',\n",
       " 'J',\n",
       " 'R',\n",
       " 'Y',\n",
       " 'A',\n",
       " 'W',\n",
       " 'O',\n",
       " 'F',\n",
       " 'S',\n",
       " 'W',\n",
       " 'C',\n",
       " 'V',\n",
       " 'B',\n",
       " 'J',\n",
       " 'O',\n",
       " 'G',\n",
       " 'G',\n",
       " 'T',\n",
       " 'O',\n",
       " 'E',\n",
       " 'S',\n",
       " 'B',\n",
       " 'L',\n",
       " 'G',\n",
       " 'J',\n",
       " 'I',\n",
       " 'F',\n",
       " 'Q',\n",
       " 'F',\n",
       " 'N',\n",
       " 'T',\n",
       " 'Q',\n",
       " 'O',\n",
       " 'O',\n",
       " 'L',\n",
       " 'M',\n",
       " 'L',\n",
       " 'A',\n",
       " 'H',\n",
       " 'G',\n",
       " 'E',\n",
       " 'Z',\n",
       " 'E',\n",
       " 'V',\n",
       " 'E',\n",
       " 'T',\n",
       " 'N',\n",
       " 'K',\n",
       " 'T',\n",
       " 'Z',\n",
       " 'M',\n",
       " 'D',\n",
       " 'O',\n",
       " 'S',\n",
       " 'P',\n",
       " 'Z',\n",
       " 'A',\n",
       " 'K',\n",
       " 'Q',\n",
       " 'H',\n",
       " 'U',\n",
       " 'H',\n",
       " 'K',\n",
       " 'L',\n",
       " 'B',\n",
       " 'I',\n",
       " 'M',\n",
       " 'Q',\n",
       " 'U',\n",
       " 'X',\n",
       " 'R',\n",
       " 'T',\n",
       " 'C',\n",
       " 'L',\n",
       " 'U',\n",
       " 'X',\n",
       " 'Y',\n",
       " 'R',\n",
       " 'O',\n",
       " 'C',\n",
       " 'F',\n",
       " 'U',\n",
       " 'E',\n",
       " 'C',\n",
       " 'X',\n",
       " 'K',\n",
       " 'A',\n",
       " 'U',\n",
       " 'J',\n",
       " 'H',\n",
       " 'U',\n",
       " 'F',\n",
       " 'Q',\n",
       " 'I',\n",
       " 'V',\n",
       " 'A',\n",
       " 'Z',\n",
       " 'J',\n",
       " 'A',\n",
       " 'E',\n",
       " 'E',\n",
       " 'I',\n",
       " 'V',\n",
       " 'I',\n",
       " 'L',\n",
       " 'H',\n",
       " 'G',\n",
       " 'T',\n",
       " 'D',\n",
       " 'A',\n",
       " 'O',\n",
       " 'M',\n",
       " 'P',\n",
       " 'K',\n",
       " 'E',\n",
       " 'Q',\n",
       " 'H',\n",
       " 'B',\n",
       " 'P',\n",
       " 'T',\n",
       " 'V',\n",
       " 'K',\n",
       " 'X',\n",
       " 'Y',\n",
       " 'A',\n",
       " 'O',\n",
       " 'X',\n",
       " 'L',\n",
       " 'M',\n",
       " 'L',\n",
       " 'F',\n",
       " 'S',\n",
       " 'D',\n",
       " 'N',\n",
       " 'E',\n",
       " 'H',\n",
       " 'P',\n",
       " 'N',\n",
       " 'F',\n",
       " 'V',\n",
       " 'M',\n",
       " 'P',\n",
       " 'R',\n",
       " 'H',\n",
       " 'S',\n",
       " 'J',\n",
       " 'C',\n",
       " 'F',\n",
       " 'O',\n",
       " 'R',\n",
       " 'D',\n",
       " 'L',\n",
       " 'D',\n",
       " 'D',\n",
       " 'I',\n",
       " 'D',\n",
       " 'J',\n",
       " 'X',\n",
       " 'L',\n",
       " 'Q',\n",
       " 'C',\n",
       " 'P',\n",
       " 'X',\n",
       " 'C',\n",
       " 'Z',\n",
       " 'V',\n",
       " 'V',\n",
       " 'P',\n",
       " 'O',\n",
       " 'C',\n",
       " 'N',\n",
       " 'F',\n",
       " 'V',\n",
       " 'Q',\n",
       " 'V',\n",
       " 'C',\n",
       " 'A',\n",
       " 'V',\n",
       " 'Q',\n",
       " 'L',\n",
       " 'B',\n",
       " 'I',\n",
       " 'K',\n",
       " 'C',\n",
       " 'C',\n",
       " 'P',\n",
       " 'P',\n",
       " 'N',\n",
       " 'E',\n",
       " 'J',\n",
       " 'L',\n",
       " 'B',\n",
       " 'S',\n",
       " 'R',\n",
       " 'T',\n",
       " 'H',\n",
       " 'Y',\n",
       " 'H',\n",
       " 'G',\n",
       " 'W',\n",
       " 'I',\n",
       " 'D',\n",
       " 'S',\n",
       " 'Y',\n",
       " 'K',\n",
       " 'C',\n",
       " 'N',\n",
       " 'O',\n",
       " 'Y',\n",
       " 'I',\n",
       " 'K',\n",
       " 'M',\n",
       " 'T',\n",
       " 'G',\n",
       " 'W',\n",
       " 'D',\n",
       " 'M',\n",
       " 'Y',\n",
       " 'Q',\n",
       " 'M',\n",
       " 'R',\n",
       " 'F',\n",
       " 'L',\n",
       " 'K',\n",
       " 'Y',\n",
       " 'E',\n",
       " 'N',\n",
       " 'M',\n",
       " 'F',\n",
       " 'G',\n",
       " 'G',\n",
       " 'D',\n",
       " 'C',\n",
       " 'N',\n",
       " 'V',\n",
       " 'F',\n",
       " 'A',\n",
       " ...]"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "key"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.01289381,  1.629349  ,  0.19742627, -0.45357196],\n",
       "       [ 0.81202469, -0.86857977, -3.01974569,  0.76283521],\n",
       "       [ 0.40017911, -0.41319575,  0.3330669 , -0.08037323],\n",
       "       ...,\n",
       "       [-1.76081295,  0.98107194, -0.03870414,  0.52049006],\n",
       "       [-0.3993499 , -0.08978031, -0.41347594, -1.4927887 ],\n",
       "       [ 0.26697869, -0.34198528, -0.25703323,  0.89534462]])"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [],
   "source": [
    "ex6['key'] = key"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [],
   "source": [
    "ex6.to_csv('examples/ex6.csv',header=True,index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = pd.read_csv('examples/ex6.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>one</th>\n",
       "      <th>two</th>\n",
       "      <th>three</th>\n",
       "      <th>four</th>\n",
       "      <th>key</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.012894</td>\n",
       "      <td>1.629349</td>\n",
       "      <td>0.197426</td>\n",
       "      <td>-0.453572</td>\n",
       "      <td>V</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.812025</td>\n",
       "      <td>-0.868580</td>\n",
       "      <td>-3.019746</td>\n",
       "      <td>0.762835</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.400179</td>\n",
       "      <td>-0.413196</td>\n",
       "      <td>0.333067</td>\n",
       "      <td>-0.080373</td>\n",
       "      <td>T</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.606644</td>\n",
       "      <td>-0.301672</td>\n",
       "      <td>-1.392047</td>\n",
       "      <td>0.583182</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.123172</td>\n",
       "      <td>0.133601</td>\n",
       "      <td>0.130493</td>\n",
       "      <td>1.100686</td>\n",
       "      <td>V</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>-0.603873</td>\n",
       "      <td>0.469950</td>\n",
       "      <td>1.248726</td>\n",
       "      <td>0.582279</td>\n",
       "      <td>Y</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>-0.281283</td>\n",
       "      <td>0.753223</td>\n",
       "      <td>-0.402113</td>\n",
       "      <td>0.414953</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.549251</td>\n",
       "      <td>-0.382449</td>\n",
       "      <td>1.178748</td>\n",
       "      <td>-1.979669</td>\n",
       "      <td>N</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-1.646155</td>\n",
       "      <td>0.519362</td>\n",
       "      <td>-0.930179</td>\n",
       "      <td>-2.049908</td>\n",
       "      <td>Z</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>-0.123112</td>\n",
       "      <td>0.206616</td>\n",
       "      <td>-0.222065</td>\n",
       "      <td>1.293704</td>\n",
       "      <td>A</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0.032023</td>\n",
       "      <td>-0.567004</td>\n",
       "      <td>0.372964</td>\n",
       "      <td>1.013570</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0.826979</td>\n",
       "      <td>-1.778039</td>\n",
       "      <td>-0.975053</td>\n",
       "      <td>0.792136</td>\n",
       "      <td>F</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>-0.003770</td>\n",
       "      <td>-0.496346</td>\n",
       "      <td>1.962516</td>\n",
       "      <td>1.224728</td>\n",
       "      <td>I</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>-0.492456</td>\n",
       "      <td>-0.028123</td>\n",
       "      <td>-1.408941</td>\n",
       "      <td>1.293925</td>\n",
       "      <td>H</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>-1.327889</td>\n",
       "      <td>-1.242199</td>\n",
       "      <td>1.290662</td>\n",
       "      <td>0.133040</td>\n",
       "      <td>E</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0.235137</td>\n",
       "      <td>1.018188</td>\n",
       "      <td>0.310884</td>\n",
       "      <td>-0.992820</td>\n",
       "      <td>E</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>-0.342637</td>\n",
       "      <td>-2.252560</td>\n",
       "      <td>-0.591797</td>\n",
       "      <td>-0.399984</td>\n",
       "      <td>H</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>-0.381930</td>\n",
       "      <td>-0.368164</td>\n",
       "      <td>0.025019</td>\n",
       "      <td>-1.015233</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2.158145</td>\n",
       "      <td>0.873234</td>\n",
       "      <td>-0.258656</td>\n",
       "      <td>-0.601598</td>\n",
       "      <td>L</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>1.305863</td>\n",
       "      <td>0.135996</td>\n",
       "      <td>-1.779428</td>\n",
       "      <td>1.701166</td>\n",
       "      <td>U</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0.215268</td>\n",
       "      <td>0.358507</td>\n",
       "      <td>-1.743525</td>\n",
       "      <td>0.813024</td>\n",
       "      <td>U</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>-2.170203</td>\n",
       "      <td>-0.742734</td>\n",
       "      <td>-0.262638</td>\n",
       "      <td>0.038062</td>\n",
       "      <td>U</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0.962036</td>\n",
       "      <td>0.432370</td>\n",
       "      <td>-0.379912</td>\n",
       "      <td>0.199172</td>\n",
       "      <td>O</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>1.717295</td>\n",
       "      <td>-0.186900</td>\n",
       "      <td>-0.862472</td>\n",
       "      <td>-0.514665</td>\n",
       "      <td>J</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>0.922364</td>\n",
       "      <td>0.364755</td>\n",
       "      <td>0.412811</td>\n",
       "      <td>-0.829306</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>-0.298121</td>\n",
       "      <td>0.403566</td>\n",
       "      <td>0.539768</td>\n",
       "      <td>1.332797</td>\n",
       "      <td>P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>0.819526</td>\n",
       "      <td>0.796840</td>\n",
       "      <td>-0.019655</td>\n",
       "      <td>1.117738</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>-0.194791</td>\n",
       "      <td>0.996866</td>\n",
       "      <td>-1.223675</td>\n",
       "      <td>-0.581495</td>\n",
       "      <td>N</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>-1.974821</td>\n",
       "      <td>-0.453128</td>\n",
       "      <td>2.043815</td>\n",
       "      <td>1.550594</td>\n",
       "      <td>X</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>-0.288994</td>\n",
       "      <td>-1.892347</td>\n",
       "      <td>0.709670</td>\n",
       "      <td>-0.188457</td>\n",
       "      <td>F</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9970</th>\n",
       "      <td>0.344166</td>\n",
       "      <td>-0.587839</td>\n",
       "      <td>-0.045719</td>\n",
       "      <td>-1.074098</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9971</th>\n",
       "      <td>-0.033163</td>\n",
       "      <td>-1.141335</td>\n",
       "      <td>-0.182231</td>\n",
       "      <td>-0.090423</td>\n",
       "      <td>T</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9972</th>\n",
       "      <td>-0.857267</td>\n",
       "      <td>0.080661</td>\n",
       "      <td>1.107977</td>\n",
       "      <td>1.208511</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9973</th>\n",
       "      <td>-0.398101</td>\n",
       "      <td>0.104804</td>\n",
       "      <td>0.386764</td>\n",
       "      <td>-0.737018</td>\n",
       "      <td>Y</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9974</th>\n",
       "      <td>1.203978</td>\n",
       "      <td>-0.457440</td>\n",
       "      <td>1.748809</td>\n",
       "      <td>-1.091051</td>\n",
       "      <td>K</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9975</th>\n",
       "      <td>-1.138568</td>\n",
       "      <td>0.540654</td>\n",
       "      <td>-1.071750</td>\n",
       "      <td>0.612080</td>\n",
       "      <td>R</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9976</th>\n",
       "      <td>-1.237319</td>\n",
       "      <td>0.033945</td>\n",
       "      <td>-0.603744</td>\n",
       "      <td>0.228129</td>\n",
       "      <td>P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9977</th>\n",
       "      <td>-0.871077</td>\n",
       "      <td>0.898290</td>\n",
       "      <td>-0.630614</td>\n",
       "      <td>-0.208253</td>\n",
       "      <td>H</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9978</th>\n",
       "      <td>-1.767069</td>\n",
       "      <td>-0.169771</td>\n",
       "      <td>-1.010387</td>\n",
       "      <td>-0.907337</td>\n",
       "      <td>N</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9979</th>\n",
       "      <td>0.968711</td>\n",
       "      <td>-1.729782</td>\n",
       "      <td>1.165624</td>\n",
       "      <td>0.589878</td>\n",
       "      <td>W</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9980</th>\n",
       "      <td>0.248412</td>\n",
       "      <td>0.475665</td>\n",
       "      <td>0.536054</td>\n",
       "      <td>-2.164706</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9981</th>\n",
       "      <td>0.243907</td>\n",
       "      <td>-1.502405</td>\n",
       "      <td>0.244401</td>\n",
       "      <td>0.353629</td>\n",
       "      <td>F</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9982</th>\n",
       "      <td>-1.253222</td>\n",
       "      <td>1.136070</td>\n",
       "      <td>-1.463256</td>\n",
       "      <td>1.176839</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9983</th>\n",
       "      <td>0.435916</td>\n",
       "      <td>-2.241411</td>\n",
       "      <td>-0.011115</td>\n",
       "      <td>1.801685</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9984</th>\n",
       "      <td>0.731219</td>\n",
       "      <td>0.321306</td>\n",
       "      <td>-1.614679</td>\n",
       "      <td>-0.229357</td>\n",
       "      <td>V</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9985</th>\n",
       "      <td>-0.873710</td>\n",
       "      <td>1.890620</td>\n",
       "      <td>-0.063711</td>\n",
       "      <td>-1.339948</td>\n",
       "      <td>E</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9986</th>\n",
       "      <td>-0.805135</td>\n",
       "      <td>0.867889</td>\n",
       "      <td>1.039107</td>\n",
       "      <td>-1.080347</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9987</th>\n",
       "      <td>0.743350</td>\n",
       "      <td>0.205980</td>\n",
       "      <td>0.339250</td>\n",
       "      <td>0.478722</td>\n",
       "      <td>F</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9988</th>\n",
       "      <td>0.027397</td>\n",
       "      <td>0.984647</td>\n",
       "      <td>-0.796543</td>\n",
       "      <td>-0.626546</td>\n",
       "      <td>A</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9989</th>\n",
       "      <td>-0.930272</td>\n",
       "      <td>-2.499178</td>\n",
       "      <td>1.362271</td>\n",
       "      <td>-0.086366</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9990</th>\n",
       "      <td>0.717834</td>\n",
       "      <td>-2.248284</td>\n",
       "      <td>0.752411</td>\n",
       "      <td>1.060644</td>\n",
       "      <td>G</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9991</th>\n",
       "      <td>1.194375</td>\n",
       "      <td>-0.377327</td>\n",
       "      <td>-0.552813</td>\n",
       "      <td>0.554743</td>\n",
       "      <td>Z</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9992</th>\n",
       "      <td>-0.575301</td>\n",
       "      <td>0.980429</td>\n",
       "      <td>1.517900</td>\n",
       "      <td>0.933533</td>\n",
       "      <td>X</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9993</th>\n",
       "      <td>-1.352885</td>\n",
       "      <td>-0.031601</td>\n",
       "      <td>-0.021974</td>\n",
       "      <td>0.401085</td>\n",
       "      <td>I</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9994</th>\n",
       "      <td>-1.684611</td>\n",
       "      <td>-0.659459</td>\n",
       "      <td>1.396720</td>\n",
       "      <td>-0.479808</td>\n",
       "      <td>B</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9995</th>\n",
       "      <td>2.395403</td>\n",
       "      <td>-0.315066</td>\n",
       "      <td>-0.569694</td>\n",
       "      <td>0.500617</td>\n",
       "      <td>P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9996</th>\n",
       "      <td>2.263735</td>\n",
       "      <td>-0.995519</td>\n",
       "      <td>-0.949883</td>\n",
       "      <td>0.036626</td>\n",
       "      <td>R</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9997</th>\n",
       "      <td>-1.760813</td>\n",
       "      <td>0.981072</td>\n",
       "      <td>-0.038704</td>\n",
       "      <td>0.520490</td>\n",
       "      <td>W</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9998</th>\n",
       "      <td>-0.399350</td>\n",
       "      <td>-0.089780</td>\n",
       "      <td>-0.413476</td>\n",
       "      <td>-1.492789</td>\n",
       "      <td>F</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9999</th>\n",
       "      <td>0.266979</td>\n",
       "      <td>-0.341985</td>\n",
       "      <td>-0.257033</td>\n",
       "      <td>0.895345</td>\n",
       "      <td>H</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10000 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           one       two     three      four key\n",
       "0    -0.012894  1.629349  0.197426 -0.453572   V\n",
       "1     0.812025 -0.868580 -3.019746  0.762835   M\n",
       "2     0.400179 -0.413196  0.333067 -0.080373   T\n",
       "3     0.606644 -0.301672 -1.392047  0.583182   Q\n",
       "4    -0.123172  0.133601  0.130493  1.100686   V\n",
       "5    -0.603873  0.469950  1.248726  0.582279   Y\n",
       "6    -0.281283  0.753223 -0.402113  0.414953   M\n",
       "7     0.549251 -0.382449  1.178748 -1.979669   N\n",
       "8    -1.646155  0.519362 -0.930179 -2.049908   Z\n",
       "9    -0.123112  0.206616 -0.222065  1.293704   A\n",
       "10    0.032023 -0.567004  0.372964  1.013570   M\n",
       "11    0.826979 -1.778039 -0.975053  0.792136   F\n",
       "12   -0.003770 -0.496346  1.962516  1.224728   I\n",
       "13   -0.492456 -0.028123 -1.408941  1.293925   H\n",
       "14   -1.327889 -1.242199  1.290662  0.133040   E\n",
       "15    0.235137  1.018188  0.310884 -0.992820   E\n",
       "16   -0.342637 -2.252560 -0.591797 -0.399984   H\n",
       "17   -0.381930 -0.368164  0.025019 -1.015233   L\n",
       "18    2.158145  0.873234 -0.258656 -0.601598   L\n",
       "19    1.305863  0.135996 -1.779428  1.701166   U\n",
       "20    0.215268  0.358507 -1.743525  0.813024   U\n",
       "21   -2.170203 -0.742734 -0.262638  0.038062   U\n",
       "22    0.962036  0.432370 -0.379912  0.199172   O\n",
       "23    1.717295 -0.186900 -0.862472 -0.514665   J\n",
       "24    0.922364  0.364755  0.412811 -0.829306   B\n",
       "25   -0.298121  0.403566  0.539768  1.332797   P\n",
       "26    0.819526  0.796840 -0.019655  1.117738   Q\n",
       "27   -0.194791  0.996866 -1.223675 -0.581495   N\n",
       "28   -1.974821 -0.453128  2.043815  1.550594   X\n",
       "29   -0.288994 -1.892347  0.709670 -0.188457   F\n",
       "...        ...       ...       ...       ...  ..\n",
       "9970  0.344166 -0.587839 -0.045719 -1.074098   S\n",
       "9971 -0.033163 -1.141335 -0.182231 -0.090423   T\n",
       "9972 -0.857267  0.080661  1.107977  1.208511   B\n",
       "9973 -0.398101  0.104804  0.386764 -0.737018   Y\n",
       "9974  1.203978 -0.457440  1.748809 -1.091051   K\n",
       "9975 -1.138568  0.540654 -1.071750  0.612080   R\n",
       "9976 -1.237319  0.033945 -0.603744  0.228129   P\n",
       "9977 -0.871077  0.898290 -0.630614 -0.208253   H\n",
       "9978 -1.767069 -0.169771 -1.010387 -0.907337   N\n",
       "9979  0.968711 -1.729782  1.165624  0.589878   W\n",
       "9980  0.248412  0.475665  0.536054 -2.164706   S\n",
       "9981  0.243907 -1.502405  0.244401  0.353629   F\n",
       "9982 -1.253222  1.136070 -1.463256  1.176839   Q\n",
       "9983  0.435916 -2.241411 -0.011115  1.801685   S\n",
       "9984  0.731219  0.321306 -1.614679 -0.229357   V\n",
       "9985 -0.873710  1.890620 -0.063711 -1.339948   E\n",
       "9986 -0.805135  0.867889  1.039107 -1.080347   C\n",
       "9987  0.743350  0.205980  0.339250  0.478722   F\n",
       "9988  0.027397  0.984647 -0.796543 -0.626546   A\n",
       "9989 -0.930272 -2.499178  1.362271 -0.086366   B\n",
       "9990  0.717834 -2.248284  0.752411  1.060644   G\n",
       "9991  1.194375 -0.377327 -0.552813  0.554743   Z\n",
       "9992 -0.575301  0.980429  1.517900  0.933533   X\n",
       "9993 -1.352885 -0.031601 -0.021974  0.401085   I\n",
       "9994 -1.684611 -0.659459  1.396720 -0.479808   B\n",
       "9995  2.395403 -0.315066 -0.569694  0.500617   P\n",
       "9996  2.263735 -0.995519 -0.949883  0.036626   R\n",
       "9997 -1.760813  0.981072 -0.038704  0.520490   W\n",
       "9998 -0.399350 -0.089780 -0.413476 -1.492789   F\n",
       "9999  0.266979 -0.341985 -0.257033  0.895345   H\n",
       "\n",
       "[10000 rows x 5 columns]"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "pd.options.display.max_rows = 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>one</th>\n",
       "      <th>two</th>\n",
       "      <th>three</th>\n",
       "      <th>four</th>\n",
       "      <th>key</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.012894</td>\n",
       "      <td>1.629349</td>\n",
       "      <td>0.197426</td>\n",
       "      <td>-0.453572</td>\n",
       "      <td>V</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.812025</td>\n",
       "      <td>-0.868580</td>\n",
       "      <td>-3.019746</td>\n",
       "      <td>0.762835</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.400179</td>\n",
       "      <td>-0.413196</td>\n",
       "      <td>0.333067</td>\n",
       "      <td>-0.080373</td>\n",
       "      <td>T</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.606644</td>\n",
       "      <td>-0.301672</td>\n",
       "      <td>-1.392047</td>\n",
       "      <td>0.583182</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.123172</td>\n",
       "      <td>0.133601</td>\n",
       "      <td>0.130493</td>\n",
       "      <td>1.100686</td>\n",
       "      <td>V</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9995</th>\n",
       "      <td>2.395403</td>\n",
       "      <td>-0.315066</td>\n",
       "      <td>-0.569694</td>\n",
       "      <td>0.500617</td>\n",
       "      <td>P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9996</th>\n",
       "      <td>2.263735</td>\n",
       "      <td>-0.995519</td>\n",
       "      <td>-0.949883</td>\n",
       "      <td>0.036626</td>\n",
       "      <td>R</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9997</th>\n",
       "      <td>-1.760813</td>\n",
       "      <td>0.981072</td>\n",
       "      <td>-0.038704</td>\n",
       "      <td>0.520490</td>\n",
       "      <td>W</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9998</th>\n",
       "      <td>-0.399350</td>\n",
       "      <td>-0.089780</td>\n",
       "      <td>-0.413476</td>\n",
       "      <td>-1.492789</td>\n",
       "      <td>F</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9999</th>\n",
       "      <td>0.266979</td>\n",
       "      <td>-0.341985</td>\n",
       "      <td>-0.257033</td>\n",
       "      <td>0.895345</td>\n",
       "      <td>H</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10000 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           one       two     three      four key\n",
       "0    -0.012894  1.629349  0.197426 -0.453572   V\n",
       "1     0.812025 -0.868580 -3.019746  0.762835   M\n",
       "2     0.400179 -0.413196  0.333067 -0.080373   T\n",
       "3     0.606644 -0.301672 -1.392047  0.583182   Q\n",
       "4    -0.123172  0.133601  0.130493  1.100686   V\n",
       "...        ...       ...       ...       ...  ..\n",
       "9995  2.395403 -0.315066 -0.569694  0.500617   P\n",
       "9996  2.263735 -0.995519 -0.949883  0.036626   R\n",
       "9997 -1.760813  0.981072 -0.038704  0.520490   W\n",
       "9998 -0.399350 -0.089780 -0.413476 -1.492789   F\n",
       "9999  0.266979 -0.341985 -0.257033  0.895345   H\n",
       "\n",
       "[10000 rows x 5 columns]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = pd.read_csv('examples/ex6.csv',nrows=5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>one</th>\n",
       "      <th>two</th>\n",
       "      <th>three</th>\n",
       "      <th>four</th>\n",
       "      <th>key</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.012894</td>\n",
       "      <td>1.629349</td>\n",
       "      <td>0.197426</td>\n",
       "      <td>-0.453572</td>\n",
       "      <td>V</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.812025</td>\n",
       "      <td>-0.868580</td>\n",
       "      <td>-3.019746</td>\n",
       "      <td>0.762835</td>\n",
       "      <td>M</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.400179</td>\n",
       "      <td>-0.413196</td>\n",
       "      <td>0.333067</td>\n",
       "      <td>-0.080373</td>\n",
       "      <td>T</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.606644</td>\n",
       "      <td>-0.301672</td>\n",
       "      <td>-1.392047</td>\n",
       "      <td>0.583182</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.123172</td>\n",
       "      <td>0.133601</td>\n",
       "      <td>0.130493</td>\n",
       "      <td>1.100686</td>\n",
       "      <td>V</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        one       two     three      four key\n",
       "0 -0.012894  1.629349  0.197426 -0.453572   V\n",
       "1  0.812025 -0.868580 -3.019746  0.762835   M\n",
       "2  0.400179 -0.413196  0.333067 -0.080373   T\n",
       "3  0.606644 -0.301672 -1.392047  0.583182   Q\n",
       "4 -0.123172  0.133601  0.130493  1.100686   V"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [],
   "source": [
    "chunker = pd.read_csv('examples/ex6.csv',chunksize=1000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pandas.io.parsers.TextFileReader at 0x1f67200d780>"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "chunker"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [],
   "source": [
    "tot = pd.Series([])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [],
   "source": [
    "for piece in chunker:\n",
    "    tot = tot.add(piece['key'].value_counts(),fill_value=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    402.0\n",
       "B    333.0\n",
       "C    458.0\n",
       "D    374.0\n",
       "E    399.0\n",
       "     ...  \n",
       "V    385.0\n",
       "W    363.0\n",
       "X    364.0\n",
       "Y    385.0\n",
       "Z    373.0\n",
       "Length: 26, dtype: float64"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    402.0\n",
       "B    333.0\n",
       "C    458.0\n",
       "D    374.0\n",
       "E    399.0\n",
       "F    378.0\n",
       "G    382.0\n",
       "H    376.0\n",
       "I    407.0\n",
       "J    390.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tot[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_csv('examples/ex5.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>something</th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>one</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>two</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>three</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11.0</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  something  a   b     c   d message\n",
       "0       one  1   2   3.0   4     NaN\n",
       "1       two  5   6   NaN   8   world\n",
       "2     three  9  10  11.0  12     foo"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.to_csv('examples/out.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.to_csv('examples/out.csv',na_rep='NULL')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.to_csv('examples/out.csv',index=False,header=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.to_csv('examples/out.csv',index=False,columns=['a','b','c'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [],
   "source": [
    "datas = pd.date_range('2019/1/1',periods=7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2019-01-01', '2019-01-02', '2019-01-03', '2019-01-04',\n",
       "               '2019-01-05', '2019-01-06', '2019-01-07'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [],
   "source": [
    "ts = pd.Series(np.arange(7),index=datas)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2019-01-01    0\n",
       "2019-01-02    1\n",
       "2019-01-03    2\n",
       "2019-01-04    3\n",
       "2019-01-05    4\n",
       "2019-01-06    5\n",
       "2019-01-07    6\n",
       "Freq: D, dtype: int32"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [],
   "source": [
    "ts.to_csv('examples/tseries.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [],
   "source": [
    "import csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [],
   "source": [
    "f = open('examples/ex7.csv')\n",
    "reader = csv.reader(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<_csv.reader at 0x1f673b0e9a0>"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reader"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['a', 'b', 'c']\n",
      "['1', '2', '3']\n",
      "['1', '2', '3']\n"
     ]
    }
   ],
   "source": [
    "for line in reader:\n",
    "    print(line)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [],
   "source": [
    "f.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('examples/ex7.csv') as f:\n",
    "    lines = list(csv.reader(f))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "header,values = lines[0],lines[1:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['1', '2', '3'], ['1', '2', '3']]"
      ]
     },
     "execution_count": 112,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['a', 'b', 'c']"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "header"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_dict = {h: v for h, v in zip(header, zip(*values))}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'a': ('1', '1'), 'b': ('2', '2'), 'c': ('3', '3')}"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [],
   "source": [
    "obj = \"\"\"\n",
    "{\"name\": \"Wes\",\n",
    "\"places_lived\": [\"United States\", \"Spain\", \"Germany\"],\n",
    "\"pet\": null,\n",
    "\"siblings\": [{\"name\": \"Scott\", \"age\": 30, \"pets\": [\"Zeus\", \"Zuko\"]},\n",
    "{\"name\": \"Katie\", \"age\": 38,\n",
    "\"pets\": [\"Sixes\", \"Stache\", \"Cisco\"]}]\n",
    "}\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\n{\"name\": \"Wes\",\\n\"places_lived\": [\"United States\", \"Spain\", \"Germany\"],\\n\"pet\": null,\\n\"siblings\": [{\"name\": \"Scott\", \"age\": 30, \"pets\": [\"Zeus\", \"Zuko\"]},\\n{\"name\": \"Katie\", \"age\": 38,\\n\"pets\": [\"Sixes\", \"Stache\", \"Cisco\"]}]\\n}\\n'"
      ]
     },
     "execution_count": 117,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "obj"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = json.loads(obj)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name': 'Wes',\n",
       " 'pet': None,\n",
       " 'places_lived': ['United States', 'Spain', 'Germany'],\n",
       " 'siblings': [{'age': 30, 'name': 'Scott', 'pets': ['Zeus', 'Zuko']},\n",
       "  {'age': 38, 'name': 'Katie', 'pets': ['Sixes', 'Stache', 'Cisco']}]}"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [],
   "source": [
    "asjson = json.dumps(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"name\": \"Wes\", \"places_lived\": [\"United States\", \"Spain\", \"Germany\"], \"pet\": null, \"siblings\": [{\"name\": \"Scott\", \"age\": 30, \"pets\": [\"Zeus\", \"Zuko\"]}, {\"name\": \"Katie\", \"age\": 38, \"pets\": [\"Sixes\", \"Stache\", \"Cisco\"]}]}'"
      ]
     },
     "execution_count": 122,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "asjson"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'age': 30, 'name': 'Scott', 'pets': ['Zeus', 'Zuko']},\n",
       " {'age': 38, 'name': 'Katie', 'pets': ['Sixes', 'Stache', 'Cisco']}]"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result['siblings']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [],
   "source": [
    " siblings = pd.DataFrame(result['siblings'], columns=['name', 'age'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Scott</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Katie</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    name  age\n",
       "0  Scott   30\n",
       "1  Katie   38"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "siblings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_json('examples/example.json')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a  b  c\n",
       "0  1  2  3\n",
       "1  4  5  6\n",
       "2  7  8  9"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"a\":{\"0\":1,\"1\":4,\"2\":7},\"b\":{\"0\":2,\"1\":5,\"2\":8},\"c\":{\"0\":3,\"1\":6,\"2\":9}}\n"
     ]
    }
   ],
   "source": [
    "print(data.to_json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[{\"a\":1,\"b\":2,\"c\":3},{\"a\":4,\"b\":5,\"c\":6},{\"a\":7,\"b\":8,\"c\":9}]\n"
     ]
    }
   ],
   "source": [
    "print(data.to_json(orient='records'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [],
   "source": [
    "data='''<INDICATOR>\n",
    "<INDICATOR_SEQ>373889</INDICATOR_SEQ>\n",
    "<PARENT_SEQ></PARENT_SEQ>\n",
    "<AGENCY_NAME>Metro-North Railroad</AGENCY_NAME><INDICATOR_NAME>Escalator Availability</INDICATOR_NAME>\n",
    "<DESCRIPTION>Percent of the time that escalators are operational\n",
    "systemwide. The availability rate is based on physical observations\n",
    "performed\n",
    "the morning of regular business days only. This is a new indicator the\n",
    "agency\n",
    "began reporting in 2009.</DESCRIPTION>\n",
    "<PERIOD_YEAR>2011</PERIOD_YEAR>\n",
    "<PERIOD_MONTH>12</PERIOD_MONTH>\n",
    "<CATEGORY>Service Indicators</CATEGORY>\n",
    "<FREQUENCY>M</FREQUENCY>\n",
    "<DESIRED_CHANGE>U</DESIRED_CHANGE>\n",
    "<INDICATOR_UNIT>%</INDICATOR_UNIT>\n",
    "<DECIMAL_PLACES>1</DECIMAL_PLACES>\n",
    "<YTD_TARGET>97.00</YTD_TARGET>\n",
    "<YTD_ACTUAL></YTD_ACTUAL>\n",
    "<MONTHLY_TARGET>97.00</MONTHLY_TARGET>\n",
    "<MONTHLY_ACTUAL></MONTHLY_ACTUAL>\n",
    "</INDICATOR>'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [],
   "source": [
    "from lxml import objectify"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('data.xml','w') as f:\n",
    "    f.write(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "metadata": {},
   "outputs": [],
   "source": [
    "parsed = objectify.parse(open('data.xml'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<lxml.etree._ElementTree at 0x1f673d2f748>"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "parsed"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [],
   "source": [
    "root = parsed.getroot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Element INDICATOR at 0x1f673d2f808>"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "root"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = []"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "metadata": {},
   "outputs": [],
   "source": [
    "skip_field = ['PARENT_SEQ', 'INDICATOR_SEQ','DESIRED_CHANGE', 'DECIMAL_PLACES']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "metadata": {},
   "outputs": [],
   "source": [
    "for elt in root:\n",
    "    el_data ={}\n",
    "    for child in elt.getchildren():\n",
    "        if child.tag in skip_field:\n",
    "            continue\n",
    "        el_data[child.tag] = child.pyval\n",
    "    data.append(el_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 152,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{},\n",
       " {'AGENCY_NAME': 'Metro-North Railroad',\n",
       "  'CATEGORY': 'Service Indicators',\n",
       "  'DESCRIPTION': 'Percent of the time that escalators are operational\\nsystemwide. The availability rate is based on physical observations\\nperformed\\nthe morning of regular business days only. This is a new indicator the\\nagency\\nbegan reporting in 2009.',\n",
       "  'FREQUENCY': 'M',\n",
       "  'INDICATOR_NAME': 'Escalator Availability',\n",
       "  'INDICATOR_UNIT': '%',\n",
       "  'MONTHLY_ACTUAL': '',\n",
       "  'MONTHLY_TARGET': 97.0,\n",
       "  'PERIOD_MONTH': 12,\n",
       "  'PERIOD_YEAR': 2011,\n",
       "  'YTD_ACTUAL': '',\n",
       "  'YTD_TARGET': 97.0}]"
      ]
     },
     "execution_count": 152,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 153,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>AGENCY_NAME</th>\n",
       "      <th>CATEGORY</th>\n",
       "      <th>DESCRIPTION</th>\n",
       "      <th>FREQUENCY</th>\n",
       "      <th>INDICATOR_NAME</th>\n",
       "      <th>INDICATOR_UNIT</th>\n",
       "      <th>MONTHLY_ACTUAL</th>\n",
       "      <th>MONTHLY_TARGET</th>\n",
       "      <th>PERIOD_MONTH</th>\n",
       "      <th>PERIOD_YEAR</th>\n",
       "      <th>YTD_ACTUAL</th>\n",
       "      <th>YTD_TARGET</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Metro-North Railroad</td>\n",
       "      <td>Service Indicators</td>\n",
       "      <td>Percent of the time that escalators are operat...</td>\n",
       "      <td>M</td>\n",
       "      <td>Escalator Availability</td>\n",
       "      <td>%</td>\n",
       "      <td></td>\n",
       "      <td>97.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td></td>\n",
       "      <td>97.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            AGENCY_NAME            CATEGORY  \\\n",
       "0                   NaN                 NaN   \n",
       "1  Metro-North Railroad  Service Indicators   \n",
       "\n",
       "                                         DESCRIPTION FREQUENCY  \\\n",
       "0                                                NaN       NaN   \n",
       "1  Percent of the time that escalators are operat...         M   \n",
       "\n",
       "           INDICATOR_NAME INDICATOR_UNIT MONTHLY_ACTUAL  MONTHLY_TARGET  \\\n",
       "0                     NaN            NaN            NaN             NaN   \n",
       "1  Escalator Availability              %                           97.0   \n",
       "\n",
       "   PERIOD_MONTH  PERIOD_YEAR YTD_ACTUAL  YTD_TARGET  \n",
       "0           NaN          NaN        NaN         NaN  \n",
       "1          12.0       2011.0                   97.0  "
      ]
     },
     "execution_count": 153,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 154,
   "metadata": {},
   "outputs": [],
   "source": [
    "from io import StringIO"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [],
   "source": [
    "tag = '<a href=\"http://www.google.com\">Google</a>'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [],
   "source": [
    "root = objectify.parse(StringIO(tag)).getroot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Element a at 0x1f674185dc8>"
      ]
     },
     "execution_count": 158,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "root"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'http://www.google.com'"
      ]
     },
     "execution_count": 159,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "root.get('href')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Google'"
      ]
     },
     "execution_count": 160,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "root.text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [],
   "source": [
    "frame = pd.read_csv('examples/ex1.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d message\n",
       "0  1   2   3   4   hello\n",
       "1  5   6   7   8   world\n",
       "2  9  10  11  12     foo"
      ]
     },
     "execution_count": 162,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "metadata": {},
   "outputs": [],
   "source": [
    "frame.to_pickle('examples/frame_pickle')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d message\n",
       "0  1   2   3   4   hello\n",
       "1  5   6   7   8   world\n",
       "2  9  10  11  12     foo"
      ]
     },
     "execution_count": 164,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_pickle('examples/frame_pickle')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
   "metadata": {},
   "outputs": [],
   "source": [
    "frame = pd.DataFrame({'a': np.random.randn(100)})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "metadata": {},
   "outputs": [],
   "source": [
    "store = pd.HDFStore('mydata.h5')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<class 'pandas.io.pytables.HDFStore'>\n",
       "File path: mydata.h5"
      ]
     },
     "execution_count": 167,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "store"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "metadata": {},
   "outputs": [],
   "source": [
    "store['obj1'] = frame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {},
   "outputs": [],
   "source": [
    "store['obj1_col'] = frame['a']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<class 'pandas.io.pytables.HDFStore'>\n",
       "File path: mydata.h5"
      ]
     },
     "execution_count": 170,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "store"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.987189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.286322</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.055033</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.529130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.633111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>1.119424</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>-0.632820</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>-0.163527</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>1.797140</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>-1.609320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           a\n",
       "0  -0.987189\n",
       "1  -0.286322\n",
       "2   0.055033\n",
       "3   0.529130\n",
       "4   0.633111\n",
       "..       ...\n",
       "95  1.119424\n",
       "96 -0.632820\n",
       "97 -0.163527\n",
       "98  1.797140\n",
       "99 -1.609320\n",
       "\n",
       "[100 rows x 1 columns]"
      ]
     },
     "execution_count": 171,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "store['obj1']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    -0.987189\n",
       "1    -0.286322\n",
       "2     0.055033\n",
       "3     0.529130\n",
       "4     0.633111\n",
       "        ...   \n",
       "95    1.119424\n",
       "96   -0.632820\n",
       "97   -0.163527\n",
       "98    1.797140\n",
       "99   -1.609320\n",
       "Name: a, Length: 100, dtype: float64"
      ]
     },
     "execution_count": 172,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "store['obj1_col']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [],
   "source": [
    "store.put('obj2',frame,format='table')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0.008723</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1.101754</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0.836069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.231406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>-0.351886</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>-1.356469</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           a\n",
       "10  0.008723\n",
       "11  1.101754\n",
       "12  0.836069\n",
       "13  0.231406\n",
       "14 -0.351886\n",
       "15 -1.356469"
      ]
     },
     "execution_count": 175,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "store.select('obj2',where=['index >= 10 and index<= 15'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 176,
   "metadata": {},
   "outputs": [],
   "source": [
    "store.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "metadata": {},
   "outputs": [],
   "source": [
    "s = pd.HDFStore('mydata.h5')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 178,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<class 'pandas.io.pytables.HDFStore'>\n",
       "File path: mydata.h5"
      ]
     },
     "execution_count": 178,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 179,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.987189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.286322</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.055033</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.529130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.633111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>1.119424</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>-0.632820</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>-0.163527</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>1.797140</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>-1.609320</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           a\n",
       "0  -0.987189\n",
       "1  -0.286322\n",
       "2   0.055033\n",
       "3   0.529130\n",
       "4   0.633111\n",
       "..       ...\n",
       "95  1.119424\n",
       "96 -0.632820\n",
       "97 -0.163527\n",
       "98  1.797140\n",
       "99 -1.609320\n",
       "\n",
       "[100 rows x 1 columns]"
      ]
     },
     "execution_count": 179,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s['obj1']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "metadata": {},
   "outputs": [],
   "source": [
    "s.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 181,
   "metadata": {},
   "outputs": [],
   "source": [
    "frame.to_hdf('mydata.h5','obj3',format='table')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.987189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.286322</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.055033</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.529130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.633111</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          a\n",
       "0 -0.987189\n",
       "1 -0.286322\n",
       "2  0.055033\n",
       "3  0.529130\n",
       "4  0.633111"
      ]
     },
     "execution_count": 183,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_hdf('mydata.h5','obj3',where=['index < 5'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 184,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = pd.read_csv('examples/ex1.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {},
   "outputs": [],
   "source": [
    "x.to_excel('examples/ex1.xlsx',index=False,header=True,sheet_name='a')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {},
   "outputs": [],
   "source": [
    "xlsx = pd.ExcelFile('examples/ex1.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 187,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pandas.io.excel.ExcelFile at 0x1f67430ac18>"
      ]
     },
     "execution_count": 187,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xlsx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<xlrd.book.Book at 0x1f67460a9b0>"
      ]
     },
     "execution_count": 189,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xlsx.book"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 190,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d message\n",
       "0  1   2   3   4   hello\n",
       "1  5   6   7   8   world\n",
       "2  9  10  11  12     foo"
      ]
     },
     "execution_count": 190,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_excel(xlsx,'a')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "metadata": {},
   "outputs": [],
   "source": [
    "frame = pd.read_excel('examples/ex1.xlsx', 'a')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "      <th>message</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>hello</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>world</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>12</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a   b   c   d message\n",
       "0  1   2   3   4   hello\n",
       "1  5   6   7   8   world\n",
       "2  9  10  11  12     foo"
      ]
     },
     "execution_count": 193,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 194,
   "metadata": {},
   "outputs": [],
   "source": [
    "writer = pd.ExcelWriter('examples/ex2.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 195,
   "metadata": {},
   "outputs": [],
   "source": [
    "frame.to_excel(writer,'a')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [],
   "source": [
    "writer.save()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {},
   "outputs": [],
   "source": [
    "frame.to_excel('examples/ex2.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {},
   "outputs": [],
   "source": [
    "url = 'https://api.github.com/repos/pandas-dev/pandas/issues'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {},
   "outputs": [],
   "source": [
    "resp = requests.get(url)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 201,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "resp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = resp.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 203,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'MEMBER',\n",
       "  'body': \"We have several functions getting called inside a `with nogil:` block that aren't currently declared as `nogil`.  In the future cython should warn in this type of situation (cython#2879).\",\n",
       "  'closed_at': None,\n",
       "  'comments': 2,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25529/comments',\n",
       "  'created_at': '2019-03-04T00:01:18Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25529/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25529',\n",
       "  'id': 416583384,\n",
       "  'labels': [],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25529/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3Nzc5Njk0',\n",
       "  'number': 25529,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25529.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25529',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25529.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25529'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'fix segfault when running with cython coverage enabled, xref cython#2879',\n",
       "  'updated_at': '2019-03-04T00:40:07Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25529',\n",
       "  'user': {'avatar_url': 'https://avatars1.githubusercontent.com/u/8078968?v=4',\n",
       "   'events_url': 'https://api.github.com/users/jbrockmendel/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/jbrockmendel/followers',\n",
       "   'following_url': 'https://api.github.com/users/jbrockmendel/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/jbrockmendel/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/jbrockmendel',\n",
       "   'id': 8078968,\n",
       "   'login': 'jbrockmendel',\n",
       "   'node_id': 'MDQ6VXNlcjgwNzg5Njg=',\n",
       "   'organizations_url': 'https://api.github.com/users/jbrockmendel/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/jbrockmendel/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/jbrockmendel/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/jbrockmendel/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/jbrockmendel'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': \"-[x] fixes 5 small (subject verb agreement, articles, formatting, duplicate conjunction) typos in the doc's user_guide _indexing.rst_ file.\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 2,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25528/comments',\n",
       "  'created_at': '2019-03-03T23:35:36Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25528/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25528',\n",
       "  'id': 416580872,\n",
       "  'labels': [],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25528/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3Nzc3OTQx',\n",
       "  'number': 25528,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25528.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25528',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25528.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25528'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'DOC: Polishing typos out of doc/source/user_guide/indexing.rst',\n",
       "  'updated_at': '2019-03-04T00:13:14Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25528',\n",
       "  'user': {'avatar_url': 'https://avatars3.githubusercontent.com/u/10225972?v=4',\n",
       "   'events_url': 'https://api.github.com/users/leerssej/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/leerssej/followers',\n",
       "   'following_url': 'https://api.github.com/users/leerssej/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/leerssej/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/leerssej',\n",
       "   'id': 10225972,\n",
       "   'login': 'leerssej',\n",
       "   'node_id': 'MDQ6VXNlcjEwMjI1OTcy',\n",
       "   'organizations_url': 'https://api.github.com/users/leerssej/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/leerssej/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/leerssej/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/leerssej/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/leerssej/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/leerssej'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': '#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\nThe first line is the problem, the others given for context.  My goal in the function this comes from is to remove non-modal (\"atypical\") items per `key`.  The task should, and does, allow multi-modal targets per group (there are other techniques to pick a unique, but arbitrary mode, but I want all of them).\\r\\n\\r\\n```python\\r\\n# Your code here\\r\\nmodes = pd.DataFrame(df.groupby(\\'key\\').value.agg(pd.Series.mode))\\r\\ndf.set_index(\\'key\\', inplace=True)\\r\\ndf = df.join(modes, rsuffix=\\'_mode\\')\\r\\ndf = df[df.apply(lambda row:row.value in row.value_mode, axis=1)]\\r\\n```\\r\\n\\r\\nThe below uses a DataFrame smaller than the one where the problem was encountered.  As discussed in a comment below, the precise sampling of the original data and the precise anonymization of groupby keys used has an unpredictable effect on the problem being accidentally fixed or continuing to occur.\\r\\n\\r\\n```python\\r\\n>>> import pandas as pd\\r\\n>>> import gzip\\r\\n>>> import pickle\\r\\n>>> df = pickle.load(gzip.open(\\'modal-crash.pkl.gz\\'))\\r\\n>>> modes = df.groupby(\\'key\\').value.agg(pd.Series.mode)\\r\\nTraceback (most recent call last):\\r\\n  File \"<ipython-input-13-4fe1f0dd3977>\", line 1, in <module>\\r\\n    modes = df.groupby(\\'key\\').value.agg(pd.Series.mode)\\r\\n  File \"/anaconda3/envs/boldmetrics-analysis/lib/python3.7/site-packages/pandas/core/groupby/generic.py\", line 778, in aggregate\\r\\n    result = self._aggregate_named(func_or_funcs, *args, **kwargs)\\r\\n  File \"/anaconda3/envs/boldmetrics-analysis/lib/python3.7/site-packages/pandas/core/groupby/generic.py\", line 909, in _aggregate_named\\r\\n    raise Exception(\\'Must produce aggregated value\\')\\r\\nException: Must produce aggregated value\\r\\n\\r\\n```\\r\\n\\r\\n[modal-crash.pkl.gz](https://github.com/pandas-dev/pandas/files/2923871/modal-crash.pkl.gz)\\r\\n\\r\\n#### Problem description\\r\\n\\r\\nIn a manner sensitive to the exact data, but not following any obvious pattern I have discerned, the `modes = ...` line can produce 3-4 levels of nested exceptions leading to `Exception: Must produce aggregated value`.\\r\\n\\r\\nI have checked the \"problem\" data to make sure there are no missing values in `df.value`.  All values are present and are an expected (string) value.  This particular task has to do with a target that is a clothing size.  E.g. when run correctly, `modes` will resemble this:\\r\\n\\r\\n```\\r\\n             value\\r\\nkey\\r\\nddhhmttmvv   [L, M]\\r\\ndfdavpqthh      [S]\\r\\nddfadjqqhd      [M]\\r\\nddvjmatfvm      [M]\\r\\n... 160k more rows ...\\r\\n```\\r\\n\\r\\nThe code succeeds for **most** initial DataFrames.  In fact, adding `df = df.iloc[:-1]` or `df = df.iloc[1:]` makes the operation succeed for every \"problem\" DataFrame I have encountered.\\r\\n\\r\\nI have identified a hack/fix to the problem, but it\\'s ad hoc and ugly:\\r\\n\\r\\n```python\\r\\ndef mode(s):\\r\\n    return list(pd.Series.mode(s))\\r\\nmodes = pd.DataFrame(df.groupby(\\'key\\').value.agg(mode))\\r\\n```\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\nExpected output shown in the problem description.  The DataFrame generated after the filtering is just a subset of rows in the original, but the problem only occurs in finding the mode per group.\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n% python -c \"import pandas; pandas.show_versions()\"\\r\\n/anaconda3/envs/boldmetrics-analysis/lib/python3.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use \"pip install psycopg2-binary\" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.\\r\\n  \"\"\")\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.7.1.final.0\\r\\npython-bits: 64\\r\\nOS: Darwin\\r\\nOS-release: 18.2.0\\r\\nmachine: x86_64\\r\\nprocessor: i386\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en_US.UTF-8\\r\\nLOCALE: en_US.UTF-8\\r\\n\\r\\npandas: 0.24.1\\r\\npytest: None\\r\\npip: 19.0.3\\r\\nsetuptools: 40.8.0\\r\\nCython: 0.29.5\\r\\nnumpy: 1.16.1\\r\\nscipy: 1.2.1\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 7.3.0\\r\\nsphinx: 1.8.4\\r\\npatsy: 0.5.1\\r\\ndateutil: 2.8.0\\r\\npytz: 2018.9\\r\\nblosc: None\\r\\nbottleneck: None\\r\\ntables: None\\r\\nnumexpr: 2.6.9\\r\\nfeather: None\\r\\nmatplotlib: 3.0.2\\r\\nopenpyxl: None\\r\\nxlrd: None\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml.etree: 4.3.1\\r\\nbs4: None\\r\\nhtml5lib: None\\r\\nsqlalchemy: 1.2.18\\r\\npymysql: None\\r\\npsycopg2: 2.7.7 (dt dec pq3 ext lo64)\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 4,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25527/comments',\n",
       "  'created_at': '2019-03-03T20:46:17Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25527/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25527',\n",
       "  'id': 416562167,\n",
       "  'labels': [{'color': '207de5',\n",
       "    'default': False,\n",
       "    'id': 307649777,\n",
       "    'name': 'Needs Info',\n",
       "    'node_id': 'MDU6TGFiZWwzMDc2NDk3Nzc=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25527/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTY1NjIxNjc=',\n",
       "  'number': 25527,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'Data dependent bug in mode aggregation',\n",
       "  'updated_at': '2019-03-04T00:26:27Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25527',\n",
       "  'user': {'avatar_url': 'https://avatars2.githubusercontent.com/u/2380665?v=4',\n",
       "   'events_url': 'https://api.github.com/users/DavidMertz/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/DavidMertz/followers',\n",
       "   'following_url': 'https://api.github.com/users/DavidMertz/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/DavidMertz/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/DavidMertz',\n",
       "   'id': 2380665,\n",
       "   'login': 'DavidMertz',\n",
       "   'node_id': 'MDQ6VXNlcjIzODA2NjU=',\n",
       "   'organizations_url': 'https://api.github.com/users/DavidMertz/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/DavidMertz/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/DavidMertz/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/DavidMertz/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/DavidMertz/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/DavidMertz'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': '[ci skip]\\r\\n\\r\\nDatetimeArray was listed twice. PeriodArray was missed.',\n",
       "  'closed_at': None,\n",
       "  'comments': 2,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25526/comments',\n",
       "  'created_at': '2019-03-03T20:14:11Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25526/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25526',\n",
       "  'id': 416558488,\n",
       "  'labels': [{'color': '3465A4',\n",
       "    'default': False,\n",
       "    'id': 134699,\n",
       "    'name': 'Docs',\n",
       "    'node_id': 'MDU6TGFiZWwxMzQ2OTk=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Docs'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25526/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 215,\n",
       "   'created_at': '2018-10-23T02:34:15Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': '',\n",
       "   'due_on': '2019-05-01T07:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/61',\n",
       "   'id': 3759483,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lMzc1OTQ4Mw==',\n",
       "   'number': 61,\n",
       "   'open_issues': 97,\n",
       "   'state': 'open',\n",
       "   'title': '0.25.0',\n",
       "   'updated_at': '2019-03-03T20:30:19Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61'},\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3NzYzOTEy',\n",
       "  'number': 25526,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25526.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25526',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25526.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25526'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'DOC: Fixed PeriodArray api ref',\n",
       "  'updated_at': '2019-03-03T21:07:54Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25526',\n",
       "  'user': {'avatar_url': 'https://avatars3.githubusercontent.com/u/1312546?v=4',\n",
       "   'events_url': 'https://api.github.com/users/TomAugspurger/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/TomAugspurger/followers',\n",
       "   'following_url': 'https://api.github.com/users/TomAugspurger/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/TomAugspurger/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/TomAugspurger',\n",
       "   'id': 1312546,\n",
       "   'login': 'TomAugspurger',\n",
       "   'node_id': 'MDQ6VXNlcjEzMTI1NDY=',\n",
       "   'organizations_url': 'https://api.github.com/users/TomAugspurger/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/TomAugspurger/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/TomAugspurger/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/TomAugspurger/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/TomAugspurger/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/TomAugspurger'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': '- [X] closes #25172 \\r\\n- [X] tests added / passed\\r\\n- [X] passes `git diff upstream/master -u -- \"*.py\" | flake8 --diff`\\r\\n- [ ] whatsnew entry\\r\\n\\r\\nOriginal number of errors: 95\\r\\nRemaining errors: 0\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 5,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25525/comments',\n",
       "  'created_at': '2019-03-03T18:24:01Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25525/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25525',\n",
       "  'id': 416546516,\n",
       "  'labels': [{'color': '3465A4',\n",
       "    'default': False,\n",
       "    'id': 134699,\n",
       "    'name': 'Docs',\n",
       "    'node_id': 'MDU6TGFiZWwxMzQ2OTk=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Docs'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25525/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 215,\n",
       "   'created_at': '2018-10-23T02:34:15Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': '',\n",
       "   'due_on': '2019-05-01T07:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/61',\n",
       "   'id': 3759483,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lMzc1OTQ4Mw==',\n",
       "   'number': 61,\n",
       "   'open_issues': 97,\n",
       "   'state': 'open',\n",
       "   'title': '0.25.0',\n",
       "   'updated_at': '2019-03-03T20:30:19Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61'},\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3NzU2MTEx',\n",
       "  'number': 25525,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25525.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25525',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25525.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25525'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'DOC: resolve all GL03 docstring validation errors',\n",
       "  'updated_at': '2019-03-03T21:15:12Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25525',\n",
       "  'user': {'avatar_url': 'https://avatars3.githubusercontent.com/u/4970459?v=4',\n",
       "   'events_url': 'https://api.github.com/users/jamescobonkerr/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/jamescobonkerr/followers',\n",
       "   'following_url': 'https://api.github.com/users/jamescobonkerr/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/jamescobonkerr/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/jamescobonkerr',\n",
       "   'id': 4970459,\n",
       "   'login': 'jamescobonkerr',\n",
       "   'node_id': 'MDQ6VXNlcjQ5NzA0NTk=',\n",
       "   'organizations_url': 'https://api.github.com/users/jamescobonkerr/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/jamescobonkerr/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/jamescobonkerr/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/jamescobonkerr/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/jamescobonkerr/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/jamescobonkerr'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': \"Initial work on #24589 \\r\\n\\r\\n- Removes hard-coded examples from _flex_doc_SERIES\\r\\n- Adds separate examples for each op (_*_example_SERIES). At this stage I've just copied the examples which were in the _flex_doc_SERIES template (add, sub, mul, div)\\r\\n- Modifies _make_flex_doc to format the _flex_doc_SERIES template with an example string from op_desc['series_examples']\\r\\n- adds references to each of the examples to _op_descriptions['series_examples'], allowing them to be picked up in _make_flex_doc\\r\\n \\r\\nOps outside not in [add, sub, mul, div] will return their docstring with no examples in this revision.\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 3,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25524/comments',\n",
       "  'created_at': '2019-03-03T17:56:04Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25524/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25524',\n",
       "  'id': 416543480,\n",
       "  'labels': [{'color': '3465A4',\n",
       "    'default': False,\n",
       "    'id': 134699,\n",
       "    'name': 'Docs',\n",
       "    'node_id': 'MDU6TGFiZWwxMzQ2OTk=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Docs'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25524/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 215,\n",
       "   'created_at': '2018-10-23T02:34:15Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': '',\n",
       "   'due_on': '2019-05-01T07:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/61',\n",
       "   'id': 3759483,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lMzc1OTQ4Mw==',\n",
       "   'number': 61,\n",
       "   'open_issues': 97,\n",
       "   'state': 'open',\n",
       "   'title': '0.25.0',\n",
       "   'updated_at': '2019-03-03T20:30:19Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61'},\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3NzU0MjE0',\n",
       "  'number': 25524,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25524.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25524',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25524.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25524'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'DOC:Remove hard-coded examples from _flex_doc_SERIES (#24589)',\n",
       "  'updated_at': '2019-03-03T20:00:40Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25524',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/8767088?v=4',\n",
       "   'events_url': 'https://api.github.com/users/danielplawrence/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/danielplawrence/followers',\n",
       "   'following_url': 'https://api.github.com/users/danielplawrence/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/danielplawrence/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/danielplawrence',\n",
       "   'id': 8767088,\n",
       "   'login': 'danielplawrence',\n",
       "   'node_id': 'MDQ6VXNlcjg3NjcwODg=',\n",
       "   'organizations_url': 'https://api.github.com/users/danielplawrence/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/danielplawrence/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/danielplawrence/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/danielplawrence/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/danielplawrence/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/danielplawrence'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': '#### Code Sample\\r\\n\\r\\n```python\\r\\nimport os\\r\\nimport pandas as pd\\r\\n\\r\\ndirectory = \\'/Data\\'\\r\\n# more than 300 files\\r\\nfor d, dirs, files in os.walk(directory):\\r\\n    # i can not use read_excel function because i do not know how many sheets in each xls\\r\\n    # i use instance of ExcelFile\\r\\n    # in fact it returns xlrd.Book instance (because engine: Acceptable values are None or ``xlrd``)\\r\\n    try\\r\\n        current_file = pd.ExcelFile(os.path.join(d,f))\\r\\n        #do not work. My files use cp1251 charset. See more in output\\r\\n    except UnicodeDecodeError:\\r\\n        pass\\r\\n\\r\\n    sheet_names_ = current_file.sheet_names()\\r\\n    for sn in current_file.sheet_names():\\r\\n        # this Data Frame i shoud parse and import to my Pstgresql DB\\r\\n        current_file.parse(sheet_name=sn)\\r\\n```\\r\\n\\r\\n#### Problem description\\r\\n\\r\\nI have a lot of XLS files encoded with cp1251. Each file contains 1 or more sheets. I need to import them into my Postgesql DB. But Pandas can not do it simple. I can load one sheet  (list of, but i don`t have it) at a time in any encoding using pandas.read_excel(file,encoding=my_encoding). Or I can load all sheets from all files in UTF encoding using instance of pandas.ExcelFile(file). It looks like some bad recursion.\\r\\nI can use xlrd to read my files with specific charset to get xlrd.Book instance. Then pass it to pandas.read_excel(). But I do not like this decision.\\r\\n\\r\\nIf pandas.ExcelFile() would have an attribute of the encoding, then it could be passed to any \"engine\". I saw a new version of excel package. The same problem.\\r\\n\\r\\n(I dont have MS Excel and can not create \"bad\" file for test)\\r\\n Sorry for my english(((\\r\\n#### Expected Output\\r\\n\\r\\n#### Output pandas/xlrd Error\\r\\n\\r\\n<details>\\r\\n\\r\\n*** No CODEPAGE record, no encoding_override: will use \\'ascii\\'\\r\\n*** No CODEPAGE record, no encoding_override: will use \\'ascii\\'\\r\\nTraceback (most recent call last):\\r\\n  File \"TableLoader.py\", line 13, in <module>\\r\\n    c = ExelLoader()\\r\\n  File \"TableLoader.py\", line 10, in ExelLoader\\r\\n    my_xls_x = pandas.read_excel(\\'Data/qq.xls\\')\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/pandas/util/_decorators.py\", line 188, in wrapper\\r\\n    return func(*args, **kwargs)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/pandas/util/_decorators.py\", line 188, in wrapper\\r\\n    return func(*args, **kwargs)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/pandas/io/excel.py\", line 350, in read_excel\\r\\n    io = ExcelFile(io, engine=engine)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/pandas/io/excel.py\", line 653, in __init__\\r\\n    self._reader = self._engines[engine](self._io)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/pandas/io/excel.py\", line 424, in __init__\\r\\n    self.book = xlrd.open_workbook(filepath_or_buffer)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/xlrd/__init__.py\", line 157, in open_workbook\\r\\n    ragged_rows=ragged_rows,\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/xlrd/book.py\", line 120, in open_workbook_xls\\r\\n    bk.get_sheets()\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/xlrd/book.py\", line 723, in get_sheets\\r\\n    self.get_sheet(sheetno)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/xlrd/book.py\", line 714, in get_sheet\\r\\n    sh.read(self)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/xlrd/sheet.py\", line 820, in read\\r\\n    strg = unpack_string(data, 6, bk.encoding or bk.derive_encoding(), lenlen=2)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/xlrd/biffh.py\", line 250, in unpack_string\\r\\n    return unicode(data[pos:pos+nchars], encoding)\\r\\n  File \"/home/dz/.local/lib/python3.6/site-packages/xlrd/timemachine.py\", line 31, in <lambda>\\r\\n    unicode = lambda b, enc: b.decode(enc)\\r\\nUnicodeDecodeError: \\'ascii\\' codec can\\'t decode byte 0xcd in position 0: ordinal not in range(128)\\r\\n\\r\\n</details>\\r\\n\\r\\n#### Output of `pd.show_versions()`\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.6.7.final.0\\r\\npython-bits: 32\\r\\nOS: Linux\\r\\nOS-release: 4.15.0-45-generic\\r\\nmachine: i686\\r\\nprocessor: i686\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: ru_RU.UTF-8\\r\\nLOCALE: ru_RU.UTF-8\\r\\n\\r\\npandas: 0.24.1\\r\\npytest: None\\r\\npip: 9.0.1\\r\\nsetuptools: 39.0.1\\r\\nCython: None\\r\\nnumpy: 1.16.2\\r\\nscipy: None\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: None\\r\\nsphinx: None\\r\\npatsy: None\\r\\ndateutil: 2.8.0\\r\\npytz: 2018.9\\r\\nblosc: None\\r\\nbottleneck: None\\r\\ntables: None\\r\\nnumexpr: None\\r\\nfeather: None\\r\\nmatplotlib: None\\r\\nopenpyxl: None\\r\\nxlrd: 1.2.0\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml.etree: None\\r\\nbs4: None\\r\\nhtml5lib: 0.999999999\\r\\nsqlalchemy: None\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: None\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 2,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25523/comments',\n",
       "  'created_at': '2019-03-03T17:00:27Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25523/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25523',\n",
       "  'id': 416537543,\n",
       "  'labels': [{'color': '4E9A06',\n",
       "    'default': False,\n",
       "    'id': 76812,\n",
       "    'name': 'Enhancement',\n",
       "    'node_id': 'MDU6TGFiZWw3NjgxMg==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement'},\n",
       "   {'color': 'bfe5bf',\n",
       "    'default': False,\n",
       "    'id': 49254273,\n",
       "    'name': 'IO Excel',\n",
       "    'node_id': 'MDU6TGFiZWw0OTI1NDI3Mw==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/IO%20Excel'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25523/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 367,\n",
       "   'created_at': '2015-01-13T10:53:19Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': 'Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.',\n",
       "   'due_on': '2020-12-31T08:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/32',\n",
       "   'id': 933188,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lOTMzMTg4',\n",
       "   'number': 32,\n",
       "   'open_issues': 1228,\n",
       "   'state': 'open',\n",
       "   'title': 'Contributions Welcome',\n",
       "   'updated_at': '2019-03-04T02:12:48Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/32'},\n",
       "  'node_id': 'MDU6SXNzdWU0MTY1Mzc1NDM=',\n",
       "  'number': 25523,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': \"ExcelFile class has no attribute 'encoding'. Is it correct?\",\n",
       "  'updated_at': '2019-03-04T03:29:26Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25523',\n",
       "  'user': {'avatar_url': 'https://avatars2.githubusercontent.com/u/48176954?v=4',\n",
       "   'events_url': 'https://api.github.com/users/Dimaskuaskus/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/Dimaskuaskus/followers',\n",
       "   'following_url': 'https://api.github.com/users/Dimaskuaskus/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/Dimaskuaskus/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/Dimaskuaskus',\n",
       "   'id': 48176954,\n",
       "   'login': 'Dimaskuaskus',\n",
       "   'node_id': 'MDQ6VXNlcjQ4MTc2OTU0',\n",
       "   'organizations_url': 'https://api.github.com/users/Dimaskuaskus/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/Dimaskuaskus/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/Dimaskuaskus/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/Dimaskuaskus/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/Dimaskuaskus/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/Dimaskuaskus'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': '- [X] closes #24971 \\r\\n- [X] tests added / passed\\r\\n- [X] passes `git diff upstream/master -u -- \"*.py\" | flake8 --diff`\\r\\n- [X] whatsnew entry\\r\\n\\r\\nThe following gives a series containing [1] instead of 1\\r\\n```\\r\\n>>> pd.Series(pd.Categorical(\\'A\\', categories=[\\'A\\', \\'B\\'])).replace({\\'A\\': 1, \\'B\\': 2})\\r\\n0    [1]\\r\\ndtype: object\\r\\n```\\r\\nThis bug occurs because in the process of copying the original categorical block (which is needed as the operation is not inplace), the constructor class for the new object defaults to `ObjectBlock`, whose constructor has a default `ndim` of 2. This PR alters the block `copy` function to specify that the newly constructed block should have the same `ndim` as the block being copied.',\n",
       "  'closed_at': None,\n",
       "  'comments': 2,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25521/comments',\n",
       "  'created_at': '2019-03-03T03:00:18Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25521/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25521',\n",
       "  'id': 416468860,\n",
       "  'labels': [{'color': '02d7e1',\n",
       "    'default': False,\n",
       "    'id': 13098779,\n",
       "    'name': 'Reshaping',\n",
       "    'node_id': 'MDU6TGFiZWwxMzA5ODc3OQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Reshaping'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25521/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3NzA4MTg0',\n",
       "  'number': 25521,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25521.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25521',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25521.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25521'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'BUG-24971 copying blocks also considers ndim',\n",
       "  'updated_at': '2019-03-03T04:50:37Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25521',\n",
       "  'user': {'avatar_url': 'https://avatars1.githubusercontent.com/u/29615021?v=4',\n",
       "   'events_url': 'https://api.github.com/users/JustinZhengBC/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/JustinZhengBC/followers',\n",
       "   'following_url': 'https://api.github.com/users/JustinZhengBC/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/JustinZhengBC/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/JustinZhengBC',\n",
       "   'id': 29615021,\n",
       "   'login': 'JustinZhengBC',\n",
       "   'node_id': 'MDQ6VXNlcjI5NjE1MDIx',\n",
       "   'organizations_url': 'https://api.github.com/users/JustinZhengBC/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/JustinZhengBC/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/JustinZhengBC/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/JustinZhengBC/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/JustinZhengBC/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/JustinZhengBC'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': 'xref #24332',\n",
       "  'closed_at': None,\n",
       "  'comments': 4,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25516/comments',\n",
       "  'created_at': '2019-03-02T16:22:39Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25516/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25516',\n",
       "  'id': 416413018,\n",
       "  'labels': [{'color': 'eb6420',\n",
       "    'default': False,\n",
       "    'id': 106935113,\n",
       "    'name': 'Style',\n",
       "    'node_id': 'MDU6TGFiZWwxMDY5MzUxMTM=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Style'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25516/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 215,\n",
       "   'created_at': '2018-10-23T02:34:15Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': '',\n",
       "   'due_on': '2019-05-01T07:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/61',\n",
       "   'id': 3759483,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lMzc1OTQ4Mw==',\n",
       "   'number': 61,\n",
       "   'open_issues': 97,\n",
       "   'state': 'open',\n",
       "   'title': '0.25.0',\n",
       "   'updated_at': '2019-03-03T20:30:19Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61'},\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3Njc0NzAz',\n",
       "  'number': 25516,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25516.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25516',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25516.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25516'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'STY: use pytest.raises context manager (frame)',\n",
       "  'updated_at': '2019-03-03T10:17:03Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25516',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/13159005?v=4',\n",
       "   'events_url': 'https://api.github.com/users/simonjayhawkins/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/simonjayhawkins/followers',\n",
       "   'following_url': 'https://api.github.com/users/simonjayhawkins/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/simonjayhawkins/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/simonjayhawkins',\n",
       "   'id': 13159005,\n",
       "   'login': 'simonjayhawkins',\n",
       "   'node_id': 'MDQ6VXNlcjEzMTU5MDA1',\n",
       "   'organizations_url': 'https://api.github.com/users/simonjayhawkins/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/simonjayhawkins/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/simonjayhawkins/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/simonjayhawkins/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/simonjayhawkins'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': \"see also #22705\\r\\n\\r\\n#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nfrom pandas import DataFrame\\r\\nfrom collections import OrderedDict\\r\\nDataFrame.from_dict(\\r\\n    OrderedDict([('b', 8), ('a', 5), ('a', 6)]))\\r\\n```\\r\\nNote: code sample from exisiting test...\\r\\nhttps://github.com/pandas-dev/pandas/blob/638ddebaa7da1e569836a5b89593b120dbbf491c/pandas/tests/frame/test_constructors.py#L1436-L1437\\r\\n\\r\\n#### Problem description\\r\\n\\r\\n```python-traceback\\r\\n---------------------------------------------------------------------------\\r\\nValueError                                Traceback (most recent call last)\\r\\n<ipython-input-7-ee89993a8718> in <module>\\r\\n      2 from collections import OrderedDict\\r\\n      3 DataFrame.from_dict(\\r\\n----> 4     OrderedDict([('b', 8), ('a', 5), ('a', 6)]))\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\frame.py in from_dict(cls, data, orient, dtype, columns)\\r\\n    983             raise ValueError('only recognize index or columns for orient')\\r\\n    984 \\r\\n--> 985         return cls(data, index=index, columns=columns, dtype=dtype)\\r\\n    986 \\r\\n    987     def to_dict(self, orient='dict', into=dict):\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\frame.py in __init__(self, data, index, columns, dtype, copy)\\r\\n    346                                  dtype=dtype, copy=copy)\\r\\n    347         elif isinstance(data, dict):\\r\\n--> 348             mgr = self._init_dict(data, index, columns, dtype=dtype)\\r\\n    349         elif isinstance(data, ma.MaskedArray):\\r\\n    350             import numpy.ma.mrecords as mrecords\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\frame.py in _init_dict(self, data, index, columns, dtype)\\r\\n    457             arrays = [data[k] for k in keys]\\r\\n    458 \\r\\n--> 459         return _arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype)\\r\\n    460 \\r\\n    461     def _init_ndarray(self, values, index, columns, dtype=None, copy=False):\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\frame.py in _arrays_to_mgr(arrays, arr_names, index, columns, dtype)\\r\\n   7354     # figure out the index, if necessary\\r\\n   7355     if index is None:\\r\\n-> 7356         index = extract_index(arrays)\\r\\n   7357 \\r\\n   7358     # don't force copy because getting jammed in an ndarray anyway\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\frame.py in extract_index(data)\\r\\n   7391 \\r\\n   7392         if not indexes and not raw_lengths:\\r\\n-> 7393             raise ValueError('If using all scalar values, you must pass'\\r\\n   7394                              ' an index')\\r\\n   7395 \\r\\n\\r\\nValueError: If using all scalar values, you must pass an index\\r\\n```\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\n[paste the output of ``pd.show_versions()`` here below this line]\\r\\n\\r\\n</details>\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25515/comments',\n",
       "  'created_at': '2019-03-02T12:05:39Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25515/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25515',\n",
       "  'id': 416390599,\n",
       "  'labels': [{'color': 'ffa0ff',\n",
       "    'default': False,\n",
       "    'id': 42670965,\n",
       "    'name': 'Error Reporting',\n",
       "    'node_id': 'MDU6TGFiZWw0MjY3MDk2NQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Error%20Reporting'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25515/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYzOTA1OTk=',\n",
       "  'number': 25515,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'BUG: inappropriate error message for DataFrame.from_dict(OrderedDict(...))',\n",
       "  'updated_at': '2019-03-03T22:51:58Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25515',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/13159005?v=4',\n",
       "   'events_url': 'https://api.github.com/users/simonjayhawkins/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/simonjayhawkins/followers',\n",
       "   'following_url': 'https://api.github.com/users/simonjayhawkins/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/simonjayhawkins/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/simonjayhawkins',\n",
       "   'id': 13159005,\n",
       "   'login': 'simonjayhawkins',\n",
       "   'node_id': 'MDQ6VXNlcjEzMTU5MDA1',\n",
       "   'organizations_url': 'https://api.github.com/users/simonjayhawkins/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/simonjayhawkins/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/simonjayhawkins/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/simonjayhawkins/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/simonjayhawkins'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': '#### Code Sample\\r\\n\\r\\n```python\\r\\nimport numpy as np\\r\\nimport pandas as pd\\r\\n\\r\\npd.set_option(\"display.precision\", 3)\\r\\n\\r\\nA = np.random.rand(3,3)\\r\\ndf_A = pd.DataFrame(A)\\r\\n\\r\\nB = np.random.rand(3,3)+1j*np.random.rand(3,3)\\r\\ndf_B = pd.DataFrame(B)\\r\\n\\r\\nprint(df_A)\\r\\nprint(df_B)\\r\\n\\r\\n```\\r\\n\\r\\n**Output:**\\r\\n\\r\\n```\\r\\n    0      1      2\\r\\n0  0.665  0.824  0.953\\r\\n1  0.341  0.078  0.408\\r\\n2  0.945  0.411  0.078\\r\\n                                            0  \\\\\\r\\n0    (0.2553045397887609+0.8464631779709604j)   \\r\\n1  (0.5724405361700162+0.047300152111596105j)   \\r\\n2     (0.5824766758024993+0.974755917539835j)   \\r\\n\\r\\n                                           1  \\\\\\r\\n0  (0.3533797280121552+0.20515824034905894j)   \\r\\n1    (0.928312255311234+0.3909443194373995j)   \\r\\n2   (0.2700966337410404+0.9137483492310767j)   \\r\\n\\r\\n                                           2  \\r\\n0  (0.21748538025578568+0.7730350615682122j)  \\r\\n1  (0.2435709287109903+0.46366472945887327j)  \\r\\n2   (0.6531622218102532+0.5102462678094016j)\\r\\n```\\r\\n\\r\\n\\r\\n\\r\\n#### Problem description\\r\\n\\r\\nDisplay precision (`pd.set_option(\"display.precision\", 3)`) doesn\\'t affect complex float numbers like shown in the example.\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\n```\\r\\n    0      1      2\\r\\n0  0.665  0.824  0.953\\r\\n1  0.341  0.078  0.408\\r\\n2  0.945  0.411  0.078\\r\\n\\r\\n               0               1               2\\r\\n0   0.976+0.935j    0.739+0.851j    0.436+0.734j\\r\\n1   0.998+0.867j    0.774+0.849j    0.553+0.749j\\r\\n2   0.405+0.049j    0.965+0.912j    0.292+0.958j\\r\\n\\r\\n```\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.6.7.final.0\\r\\npython-bits: 64\\r\\nOS: Windows\\r\\nOS-release: 10\\r\\nmachine: AMD64\\r\\nprocessor: Intel64 Family 6 Model 142 Stepping 9, GenuineIntel\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: None\\r\\nLOCALE: None.None\\r\\n\\r\\npandas: 0.23.4\\r\\npytest: None\\r\\npip: 18.1\\r\\nsetuptools: 39.0.1\\r\\nCython: 0.29\\r\\nnumpy: 1.15.4\\r\\nscipy: 1.1.0\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 7.1.1\\r\\nsphinx: None\\r\\npatsy: None\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.9\\r\\nblosc: None\\r\\nbottleneck: 1.2.1\\r\\ntables: None\\r\\nnumexpr: None\\r\\nfeather: None\\r\\nmatplotlib: 3.0.1\\r\\nopenpyxl: None\\r\\nxlrd: None\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml: None\\r\\nbs4: None\\r\\nhtml5lib: None\\r\\nsqlalchemy: None\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 1,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25514/comments',\n",
       "  'created_at': '2019-03-01T20:11:25Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25514/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25514',\n",
       "  'id': 416261223,\n",
       "  'labels': [{'color': 'e10c02',\n",
       "    'default': False,\n",
       "    'id': 76811,\n",
       "    'name': 'Bug',\n",
       "    'node_id': 'MDU6TGFiZWw3NjgxMQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Bug'},\n",
       "   {'color': 'ededed',\n",
       "    'default': False,\n",
       "    'id': 13101118,\n",
       "    'name': 'Output-Formatting',\n",
       "    'node_id': 'MDU6TGFiZWwxMzEwMTExOA==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Output-Formatting'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25514/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYyNjEyMjM=',\n",
       "  'number': 25514,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': \"Display precision doesn't affect complex float numbers\",\n",
       "  'updated_at': '2019-03-03T22:54:16Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25514',\n",
       "  'user': {'avatar_url': 'https://avatars3.githubusercontent.com/u/9380980?v=4',\n",
       "   'events_url': 'https://api.github.com/users/jay-pee/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/jay-pee/followers',\n",
       "   'following_url': 'https://api.github.com/users/jay-pee/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/jay-pee/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/jay-pee',\n",
       "   'id': 9380980,\n",
       "   'login': 'jay-pee',\n",
       "   'node_id': 'MDQ6VXNlcjkzODA5ODA=',\n",
       "   'organizations_url': 'https://api.github.com/users/jay-pee/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/jay-pee/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/jay-pee/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/jay-pee/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/jay-pee/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/jay-pee'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': '#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nfrom __future__ import print_function\\r\\n\\r\\nimport pandas as pd\\r\\n\\r\\ndf = pd.DataFrame.from_records(\\r\\n    [\\r\\n        {\\'id\\': \\'abc\\', \\'data\\': \\'qwerty\\'},\\r\\n        {\\'id\\': \\'def\\', \\'data\\': \\'uiop\\'}\\r\\n    ],\\r\\n    index=\\'id\\'\\r\\n)\\r\\n\\r\\nprint(df.to_json(orient=\\'records\\', index=True))\\r\\n\\r\\n# Prints out:\\r\\n[{\"data\":\"qwerty\"},{\"data\":\"uiop\"}]\\r\\n\\r\\nseries = df.squeeze()\\r\\nprint(series.to_json(orient=\\'records\\', index=True))\\r\\n\\r\\n# Prints out:\\r\\n[\"qwerty\",\"uiop\"]\\r\\n```\\r\\n#### Problem description\\r\\n\\r\\nWhen creating a `DataFrame` that has two columns, one to be used as an index and another for the data, if you call `.to_json(orient=\\'records\\')` the index is omitted. I know that in theory I should be using a `Series` for this, but I\\'m using it to convert a CSV file into JSONL and I don\\'t know what the CSV file is going to look like ahead of time.\\r\\n\\r\\nIn any case, squeezing the `DataFrame` into a `Series` doesn\\'t work either. In fact, the bug in `Series.to_json` is even worse, as it produces an array of strings instead of an array of dictionaries.\\r\\n\\r\\nThis bug is present in master.\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\nExpected output is:\\r\\n\\r\\n```json\\r\\n[{\"id\":\"abc\", \"data\":\"qwerty\"},{\"id\":\"def\",\"data\":\"uiop\"}]\\r\\n```\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.7.2.final.0\\r\\npython-bits: 64\\r\\nOS: Darwin\\r\\nOS-release: 17.7.0\\r\\nmachine: x86_64\\r\\nprocessor: i386\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en_US.UTF-8\\r\\nLOCALE: en_US.UTF-8\\r\\n\\r\\npandas: 0.24.1\\r\\npytest: 4.3.0\\r\\npip: 19.0.3\\r\\nsetuptools: 40.8.0\\r\\nCython: 0.29.6\\r\\nnumpy: 1.16.2\\r\\nscipy: None\\r\\npyarrow: 0.12.1\\r\\nxarray: None\\r\\nIPython: None\\r\\nsphinx: None\\r\\npatsy: None\\r\\ndateutil: 2.8.0\\r\\npytz: 2018.9\\r\\nblosc: None\\r\\nbottleneck: None\\r\\ntables: None\\r\\nnumexpr: None\\r\\nfeather: None\\r\\nmatplotlib: None\\r\\nopenpyxl: None\\r\\nxlrd: None\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml.etree: None\\r\\nbs4: None\\r\\nhtml5lib: None\\r\\nsqlalchemy: None\\r\\npymysql: None\\r\\npsycopg2: 2.7.7 (dt dec pq3 ext lo64)\\r\\njinja2: None\\r\\ns3fs: 0.2.0\\r\\nfastparquet: 0.2.1\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25513/comments',\n",
       "  'created_at': '2019-03-01T19:43:00Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25513/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25513',\n",
       "  'id': 416251532,\n",
       "  'labels': [{'color': 'e10c02',\n",
       "    'default': False,\n",
       "    'id': 76811,\n",
       "    'name': 'Bug',\n",
       "    'node_id': 'MDU6TGFiZWw3NjgxMQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Bug'},\n",
       "   {'color': '207de5',\n",
       "    'default': False,\n",
       "    'id': 49379259,\n",
       "    'name': 'IO JSON',\n",
       "    'node_id': 'MDU6TGFiZWw0OTM3OTI1OQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/IO%20JSON'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25513/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYyNTE1MzI=',\n",
       "  'number': 25513,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': \"to_json(orient='records') omits index if df has one column\",\n",
       "  'updated_at': '2019-03-04T01:30:21Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25513',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/620513?v=4',\n",
       "   'events_url': 'https://api.github.com/users/dargueta/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/dargueta/followers',\n",
       "   'following_url': 'https://api.github.com/users/dargueta/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/dargueta/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/dargueta',\n",
       "   'id': 620513,\n",
       "   'login': 'dargueta',\n",
       "   'node_id': 'MDQ6VXNlcjYyMDUxMw==',\n",
       "   'organizations_url': 'https://api.github.com/users/dargueta/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/dargueta/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/dargueta/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/dargueta/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/dargueta/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/dargueta'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': '#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nimport pandas as pd\\r\\n\\r\\n# Doesn\\'t work\\r\\npd.to_datetime(pd.Series([pd.np.nan, \\'19750501\\', \\'19820001\\', \\'19770501\\']), format=\\'%Y%m%d\\', errors=\\'coerce\\')\\r\\npd.to_datetime(pd.Series([\\'19750501\\', pd.np.nan, \\'19820001\\', \\'19770501\\']), format=\\'%Y%m%d\\', errors=\\'coerce\\')\\r\\n\\r\\n# Works\\r\\npd.to_datetime(pd.Series([\\'19750501\\', \\'19820001\\', \\'19770501\\']), format=\\'%Y%m%d\\', errors=\\'coerce\\')\\r\\n\\r\\n# Works\\r\\npd.to_datetime(pd.Series([\\'19750501\\', \\'19820001\\', pd.np.nan, \\'19770501\\']), format=\\'%Y%m%d\\', errors=\\'coerce\\')\\r\\n\\r\\n```\\r\\n#### Problem description\\r\\n\\r\\nwith errors=\\'ignore\\' or \\'coerce\\', pandas should be able to ignore the wrong datetime \\'19820001\\' in it. However, if there is NaN before the wrong datetime, pandas returns error \"OverflowError: signed integer is less than minimum\"\\r\\n\\r\\nIt only happens when format %Y%m%d\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.6.4.final.0\\r\\npython-bits: 64\\r\\nOS: Darwin\\r\\nOS-release: 18.2.0\\r\\nmachine: x86_64\\r\\nprocessor: i386\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: None\\r\\nLOCALE: en_US.UTF-8\\r\\npandas: 0.24.1\\r\\npytest: None\\r\\npip: 19.0.3\\r\\nsetuptools: 40.8.0\\r\\nCython: None\\r\\nnumpy: 1.16.1\\r\\nscipy: 1.2.1\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 7.2.0\\r\\nsphinx: None\\r\\npatsy: None\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.9\\r\\nblosc: None\\r\\nbottleneck: None\\r\\ntables: None\\r\\nnumexpr: None\\r\\nfeather: None\\r\\nmatplotlib: None\\r\\nopenpyxl: None\\r\\nxlrd: 1.2.0\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml.etree: None\\r\\nbs4: None\\r\\nhtml5lib: None\\r\\nsqlalchemy: 1.2.17\\r\\npymysql: 0.9.3\\r\\npsycopg2: 2.7.7 (dt dec pq3 ext lo64)\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25512/comments',\n",
       "  'created_at': '2019-03-01T19:23:06Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25512/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25512',\n",
       "  'id': 416244688,\n",
       "  'labels': [{'color': 'e10c02',\n",
       "    'default': False,\n",
       "    'id': 76811,\n",
       "    'name': 'Bug',\n",
       "    'node_id': 'MDU6TGFiZWw3NjgxMQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Bug'},\n",
       "   {'color': 'AFEEEE',\n",
       "    'default': False,\n",
       "    'id': 211840,\n",
       "    'name': 'Timeseries',\n",
       "    'node_id': 'MDU6TGFiZWwyMTE4NDA=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25512/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYyNDQ2ODg=',\n",
       "  'number': 25512,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'to_datetime does not ignore the error when there is NaN before wrong datetime when format is %Y%m%d',\n",
       "  'updated_at': '2019-03-02T23:06:07Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25512',\n",
       "  'user': {'avatar_url': 'https://avatars2.githubusercontent.com/u/2060045?v=4',\n",
       "   'events_url': 'https://api.github.com/users/ligyxy/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/ligyxy/followers',\n",
       "   'following_url': 'https://api.github.com/users/ligyxy/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/ligyxy/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/ligyxy',\n",
       "   'id': 2060045,\n",
       "   'login': 'ligyxy',\n",
       "   'node_id': 'MDQ6VXNlcjIwNjAwNDU=',\n",
       "   'organizations_url': 'https://api.github.com/users/ligyxy/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/ligyxy/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/ligyxy/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/ligyxy/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/ligyxy/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/ligyxy'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': 'With a DatetimeIndex I can specify the rolling window using an offset alias, but if I want to skip the first (incomplete) window, I would need to calculate the number of periods in the window. Rolling is hence using different units for the window and min_period functionality. I would like to be able to skip all periods in the first n windows. \\r\\n\\r\\nPossible implementations could be:\\r\\nmin_periods=\\'7D\\'\\r\\nmin_periods=window\\r\\nskip_windows=n \\r\\nskip_window=True. \\r\\n\\r\\nn=1 is probably good enough for most use cases.\\r\\n\\r\\n #### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\n# Generate example dataframe:\\r\\nidx = pd.date_range(\"2019-03-01\", periods=10000, freq=\\'5T\\')\\r\\ndf = pd.DataFrame(np.sin(np.arange(0,100,0.01)), index=idx)\\r\\n\\r\\n# Plot data\\r\\nplt.plot(df)\\r\\n\\r\\n# Plot rolling mean with vertical offset for visual separation\\r\\nplt.plot(df.rolling(\\'7D\\').mean() + 0.2)\\r\\n\\r\\n# Plot rolling mean with time offset equal to 1 window\\r\\nperiods = pd.to_timedelta(\\'7D\\')//df.index.freq\\r\\nplt.plot(df.rolling(\\'7D\\', min_periods=periods).mean())\\r\\n\\r\\nplt.show()\\r\\n```\\r\\n#### Problem description\\r\\n\\r\\n\\'min_periods\\' accepts only integer values. A min_periods value less than the number of periods in the window is not representative as there are too few observations. The documentation is very confusing with respect to time series since the \"offset\" apparently does not refer to an offset alias: \"For a window that is specified by an offset, min_periods will default to 1. Otherwise, min_periods will default to the size of the window.\" \\r\\n\\r\\n<details>\\r\\n\\r\\n[paste the output of ``pd.show_versions()`` here below this line]\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.6.5.final.0\\r\\npython-bits: 64\\r\\nOS: Windows\\r\\nOS-release: 10\\r\\nmachine: AMD64\\r\\nprocessor: Intel64 Family 6 Model 142 Stepping 9, GenuineIntel\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: None\\r\\nLOCALE: None.None\\r\\n\\r\\npandas: 0.23.1\\r\\npytest: 3.5.1\\r\\npip: 18.1\\r\\nsetuptools: 39.1.0\\r\\nCython: 0.28.2\\r\\nnumpy: 1.14.3\\r\\nscipy: 1.1.0\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 6.4.0\\r\\nsphinx: 1.7.4\\r\\npatsy: 0.5.0\\r\\ndateutil: 2.7.2\\r\\npytz: 2018.4\\r\\nblosc: None\\r\\nbottleneck: 1.2.1\\r\\ntables: 3.4.3\\r\\nnumexpr: 2.6.5\\r\\nfeather: None\\r\\nmatplotlib: 2.2.2\\r\\nopenpyxl: 2.5.3\\r\\nxlrd: 1.1.0\\r\\nxlwt: 1.3.0\\r\\nxlsxwriter: 1.0.4\\r\\nlxml: 4.2.1\\r\\nbs4: 4.6.0\\r\\nhtml5lib: 1.0.1\\r\\nsqlalchemy: 1.2.7\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25510/comments',\n",
       "  'created_at': '2019-03-01T17:52:38Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25510/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25510',\n",
       "  'id': 416213318,\n",
       "  'labels': [],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25510/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYyMTMzMTg=',\n",
       "  'number': 25510,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'New feature request: skip_window(s) for df.rolling',\n",
       "  'updated_at': '2019-03-01T19:06:11Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25510',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/30837525?v=4',\n",
       "   'events_url': 'https://api.github.com/users/Turanga1/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/Turanga1/followers',\n",
       "   'following_url': 'https://api.github.com/users/Turanga1/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/Turanga1/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/Turanga1',\n",
       "   'id': 30837525,\n",
       "   'login': 'Turanga1',\n",
       "   'node_id': 'MDQ6VXNlcjMwODM3NTI1',\n",
       "   'organizations_url': 'https://api.github.com/users/Turanga1/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/Turanga1/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/Turanga1/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/Turanga1/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/Turanga1/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/Turanga1'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': '#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nimport pandas as pd\\r\\ndf = pd.DataFrame({\\'\\\\ud83d\\': []})\\r\\n_ = dir(df)\\r\\n```\\r\\n\\r\\n```python-traceback\\r\\n---------------------------------------------------------------------------\\r\\nUnicodeEncodeError                        Traceback (most recent call last)\\r\\n<ipython-input-3-4e949fe17c82> in <module>\\r\\n----> 1 _ = dir(df)\\r\\n\\r\\n~/miniconda/envs/dev/lib/python3.7/site-packages/pandas/core/accessor.py in __dir__(self)\\r\\n     37         \"\"\"\\r\\n     38         rv = set(dir(type(self)))\\r\\n---> 39         rv = (rv - self._dir_deletions()) | self._dir_additions()\\r\\n     40         return sorted(rv)\\r\\n     41\\r\\n\\r\\n~/miniconda/envs/dev/lib/python3.7/site-packages/pandas/core/generic.py in _dir_additions(self)\\r\\n   5110         If info_axis is a MultiIndex, it\\'s first level values are used.\\r\\n   5111         \"\"\"\\r\\n-> 5112         additions = {c for c in self._info_axis.unique(level=0)[:100]\\r\\n   5113                      if isinstance(c, string_types) and isidentifier(c)}\\r\\n   5114         return super(NDFrame, self)._dir_additions().union(additions)\\r\\n\\r\\n~/miniconda/envs/dev/lib/python3.7/site-packages/pandas/core/indexes/base.py in unique(self, level)\\r\\n   1999         if level is not None:\\r\\n   2000             self._validate_index_level(level)\\r\\n-> 2001         result = super(Index, self).unique()\\r\\n   2002         return self._shallow_copy(result)\\r\\n   2003\\r\\n\\r\\n~/miniconda/envs/dev/lib/python3.7/site-packages/pandas/core/base.py in unique(self)\\r\\n   1312         else:\\r\\n   1313             from pandas.core.algorithms import unique1d\\r\\n-> 1314             result = unique1d(values)\\r\\n   1315\\r\\n   1316         return result\\r\\n\\r\\n~/miniconda/envs/dev/lib/python3.7/site-packages/pandas/core/algorithms.py in unique(values)\\r\\n    360\\r\\n    361     table = htable(len(values))\\r\\n--> 362     uniques = table.unique(values)\\r\\n    363     uniques = _reconstruct_data(uniques, dtype, original)\\r\\n    364     return uniques\\r\\n\\r\\npandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.StringHashTable.unique()\\r\\n\\r\\npandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.StringHashTable._unique()\\r\\n\\r\\nUnicodeEncodeError: \\'utf-8\\' codec can\\'t encode character \\'\\\\ud83d\\' in position 0: surrogates not allowed\\r\\n```\\r\\n\\r\\n#### Problem description\\r\\n\\r\\nDir fails on dataframes with pathalogical column names\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.7.1.final.0\\r\\npython-bits: 64\\r\\nOS: Darwin\\r\\nOS-release: 18.2.0\\r\\nmachine: x86_64\\r\\nprocessor: i386\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en_US.UTF-8\\r\\nLOCALE: en_US.UTF-8\\r\\n\\r\\npandas: 0.24.1\\r\\npytest: 3.10.1\\r\\npip: 18.1\\r\\nsetuptools: 40.6.2\\r\\nCython: None\\r\\nnumpy: 1.15.4\\r\\nscipy: 1.1.0\\r\\npyarrow: 0.11.1\\r\\nxarray: 0.11.3\\r\\nIPython: 7.2.0\\r\\nsphinx: 1.8.4\\r\\npatsy: None\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.7\\r\\nblosc: None\\r\\nbottleneck: None\\r\\ntables: None\\r\\nnumexpr: None\\r\\nfeather: None\\r\\nmatplotlib: None\\r\\nopenpyxl: None\\r\\nxlrd: None\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml.etree: None\\r\\nbs4: None\\r\\nhtml5lib: None\\r\\nsqlalchemy: None\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: 0.2.0\\r\\nfastparquet: 0.1.6\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25509/comments',\n",
       "  'created_at': '2019-03-01T17:42:53Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25509/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25509',\n",
       "  'id': 416209839,\n",
       "  'labels': [],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25509/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYyMDk4Mzk=',\n",
       "  'number': 25509,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'Dir fails on dataframes with pathological column names',\n",
       "  'updated_at': '2019-03-03T02:34:05Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25509',\n",
       "  'user': {'avatar_url': 'https://avatars3.githubusercontent.com/u/306380?v=4',\n",
       "   'events_url': 'https://api.github.com/users/mrocklin/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/mrocklin/followers',\n",
       "   'following_url': 'https://api.github.com/users/mrocklin/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/mrocklin/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/mrocklin',\n",
       "   'id': 306380,\n",
       "   'login': 'mrocklin',\n",
       "   'node_id': 'MDQ6VXNlcjMwNjM4MA==',\n",
       "   'organizations_url': 'https://api.github.com/users/mrocklin/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/mrocklin/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/mrocklin/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/mrocklin/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/mrocklin/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/mrocklin'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': 'The following code fails on 0.24.1, doesn\\'t fail on 0.23.4 but result was wrong.\\r\\n\\r\\n```python\\r\\nfrom datetime import datetime, timezone, timedelta\\r\\n\\r\\nstart = datetime(2019, 1, 1, tzinfo=timezone.utc)\\r\\n\\r\\ndf = pd.DataFrame.from_records(\\r\\n    {\\r\\n        \"date\": [start + timedelta(days=i) for i in range(5)],\\r\\n        \"value\": list(range(5)),\\r\\n        \"ref_date\": [start + timedelta(days=i) for i in range(5)],\\r\\n    }\\r\\n)\\r\\n\\r\\ndf.set_index(\"date\").resample(\"1H\").interpolate(\"linear\")\\r\\n```\\r\\n\\r\\nThings work again if:\\r\\n- one makes `start` tz-naive;\\r\\n- one removes column `ref_date`.',\n",
       "  'closed_at': None,\n",
       "  'comments': 4,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25508/comments',\n",
       "  'created_at': '2019-03-01T16:33:27Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25508/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25508',\n",
       "  'id': 416182612,\n",
       "  'labels': [{'color': 'fbca04',\n",
       "    'default': False,\n",
       "    'id': 195647922,\n",
       "    'name': 'Difficulty Intermediate',\n",
       "    'node_id': 'MDU6TGFiZWwxOTU2NDc5MjI=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Difficulty%20Intermediate'},\n",
       "   {'color': '006b75',\n",
       "    'default': False,\n",
       "    'id': 195648017,\n",
       "    'name': 'Effort Medium',\n",
       "    'node_id': 'MDU6TGFiZWwxOTU2NDgwMTc=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Effort%20Medium'},\n",
       "   {'color': '6138b5',\n",
       "    'default': False,\n",
       "    'id': 849023693,\n",
       "    'name': 'ExtensionArray',\n",
       "    'node_id': 'MDU6TGFiZWw4NDkwMjM2OTM=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/ExtensionArray'},\n",
       "   {'color': 'd7e102',\n",
       "    'default': False,\n",
       "    'id': 2822342,\n",
       "    'name': 'Missing-data',\n",
       "    'node_id': 'MDU6TGFiZWwyODIyMzQy',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data'},\n",
       "   {'color': 'AFEEEE',\n",
       "    'default': False,\n",
       "    'id': 211840,\n",
       "    'name': 'Timeseries',\n",
       "    'node_id': 'MDU6TGFiZWwyMTE4NDA=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25508/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 367,\n",
       "   'created_at': '2015-01-13T10:53:19Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': 'Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.',\n",
       "   'due_on': '2020-12-31T08:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/32',\n",
       "   'id': 933188,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lOTMzMTg4',\n",
       "   'number': 32,\n",
       "   'open_issues': 1228,\n",
       "   'state': 'open',\n",
       "   'title': 'Contributions Welcome',\n",
       "   'updated_at': '2019-03-04T02:12:48Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/32'},\n",
       "  'node_id': 'MDU6SXNzdWU0MTYxODI2MTI=',\n",
       "  'number': 25508,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'Linear interpolation fails on tz-aware Series',\n",
       "  'updated_at': '2019-03-01T20:32:29Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25508',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/1360812?v=4',\n",
       "   'events_url': 'https://api.github.com/users/xoolive/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/xoolive/followers',\n",
       "   'following_url': 'https://api.github.com/users/xoolive/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/xoolive/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/xoolive',\n",
       "   'id': 1360812,\n",
       "   'login': 'xoolive',\n",
       "   'node_id': 'MDQ6VXNlcjEzNjA4MTI=',\n",
       "   'organizations_url': 'https://api.github.com/users/xoolive/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/xoolive/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/xoolive/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/xoolive/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/xoolive/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/xoolive'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': '#### Code Sample\\r\\n\\r\\n```python\\r\\nimport pandas as pd\\r\\nimport time\\r\\n\\r\\nsquares = set(a**2 for a in range(100000000))\\r\\nseries = pd.Series(range(100))\\r\\n\\r\\nstart = time.time()\\r\\napply_result = series.apply(lambda x: x in squares)\\r\\napply_end = time.time()\\r\\nisin_result = series.isin(squares)\\r\\nisin_end = time.time()\\r\\n\\r\\nassert((apply_result==isin_result).all())\\r\\n\\r\\nprint(\"pandas.Series.apply() took {} seconds and pandas.Series.isin() took {} seconds.\".format(apply_end - start, isin_end - apply_end))\\r\\n\\r\\n```\\r\\nOutput:\\r\\n\\r\\n> pandas.Series.apply() took 0.0044422149658203125 seconds and pandas.Series.isin() took 72.23143887519836 seconds.\\r\\n\\r\\n#### Problem description\\r\\nWhen a set is passed to `pandas.Series.isin`, the set is [converted to a list](https://github.com/pandas-dev/pandas/blob/37da2c100fd09cbe8f98c78c642a978c3fae98c9/pandas/core/algorithms.py#L394), before being converted back to a hash table. Consequently, the run time is linear in the size of the set, which is not ideal because one of the main reasons to use a set is that membership can be tested in constant time.\\r\\n#### Suggested improvements\\r\\nThe quick and dirty workaround is to use `pandas.Series.apply` (as in the above code sample) instead of `pandas.Series.isin`. I\\'m not familiar enough with pandas internals to know whether there are edge cases where this would fail or whether it would be a bad idea to incorporate this workaround into `isin` directly. I would suggest, however, that at a minimum the documentation for `isin` be updated to mention that a set will be converted to a list and that this has performance implications, so that users can choose an alternative approach. (I am happy to contribute the documentation if this is the preferred solution.)\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.6.0.final.0\\r\\npython-bits: 64\\r\\nOS: Darwin\\r\\nOS-release: 18.2.0\\r\\nmachine: x86_64\\r\\nprocessor: i386\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en_US.UTF-8\\r\\nLOCALE: en_US.UTF-8\\r\\n\\r\\npandas: 0.24.1\\r\\npytest: 3.0.5\\r\\npip: 19.0.3\\r\\nsetuptools: 27.2.0\\r\\nCython: 0.25.2\\r\\nnumpy: 1.16.2\\r\\nscipy: 0.18.1\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 5.3.0\\r\\nsphinx: 1.5.1\\r\\npatsy: 0.4.1\\r\\ndateutil: 2.6.0\\r\\npytz: 2016.10\\r\\nblosc: None\\r\\nbottleneck: 1.2.0\\r\\ntables: 3.3.0\\r\\nnumexpr: 2.6.1\\r\\nfeather: None\\r\\nmatplotlib: 2.0.0\\r\\nopenpyxl: 2.4.1\\r\\nxlrd: 1.0.0\\r\\nxlwt: 1.2.0\\r\\nxlsxwriter: 0.9.6\\r\\nlxml.etree: 3.7.2\\r\\nbs4: 4.5.3\\r\\nhtml5lib: 0.9999999\\r\\nsqlalchemy: 1.1.5\\r\\npymysql: None\\r\\npsycopg2: 2.7.4 (dt dec pq3 ext lo64)\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 1,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25507/comments',\n",
       "  'created_at': '2019-03-01T16:09:21Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25507/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25507',\n",
       "  'id': 416172033,\n",
       "  'labels': [{'color': 'a10c02',\n",
       "    'default': False,\n",
       "    'id': 8935311,\n",
       "    'name': 'Performance',\n",
       "    'node_id': 'MDU6TGFiZWw4OTM1MzEx',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Performance'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25507/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 367,\n",
       "   'created_at': '2015-01-13T10:53:19Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': 'Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.',\n",
       "   'due_on': '2020-12-31T08:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/32',\n",
       "   'id': 933188,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lOTMzMTg4',\n",
       "   'number': 32,\n",
       "   'open_issues': 1228,\n",
       "   'state': 'open',\n",
       "   'title': 'Contributions Welcome',\n",
       "   'updated_at': '2019-03-04T02:12:48Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/32'},\n",
       "  'node_id': 'MDU6SXNzdWU0MTYxNzIwMzM=',\n",
       "  'number': 25507,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'pandas.Series.isin() is slow on large sets due to conversion of set to list',\n",
       "  'updated_at': '2019-03-01T17:42:06Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25507',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/1190046?v=4',\n",
       "   'events_url': 'https://api.github.com/users/amerberg/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/amerberg/followers',\n",
       "   'following_url': 'https://api.github.com/users/amerberg/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/amerberg/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/amerberg',\n",
       "   'id': 1190046,\n",
       "   'login': 'amerberg',\n",
       "   'node_id': 'MDQ6VXNlcjExOTAwNDY=',\n",
       "   'organizations_url': 'https://api.github.com/users/amerberg/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/amerberg/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/amerberg/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/amerberg/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/amerberg/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/amerberg'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': \"#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nimport pytz \\r\\nimport pandas \\r\\n\\r\\nseries = pd.Series(pd.Timestamp('2017-08-05 00:00:00+0100', tz=pytz.FixedOffset(60)))\\r\\nseries.at[1] = pd.Timestamp('2017-08-05 00:00:00+0100', tz=pytz.FixedOffset(60))\\r\\n\\r\\n# this produces \\r\\nTypeError: Argument 'arr' has incorrect type (expected numpy.ndarray, got DatetimeArray)\\r\\n```\\r\\n#### Problem description\\r\\nI would expect to be able to operate on a series of timestamps\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\nno error \\r\\n\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.6.7.final.0\\r\\npython-bits: 64\\r\\nOS: Linux\\r\\nOS-release: 4.15.0-45-generic\\r\\nmachine: x86_64\\r\\nprocessor: x86_64\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en_US.UTF-8\\r\\nLOCALE: en_US.UTF-8\\r\\n\\r\\npandas: 0.23.4\\r\\npytest: 4.1.1\\r\\npip: 18.1\\r\\nsetuptools: 40.6.3\\r\\nCython: None\\r\\nnumpy: 1.16.0\\r\\nscipy: 1.2.0\\r\\npyarrow: None\\r\\nxarray: 0.11.3\\r\\nIPython: 7.2.0\\r\\nsphinx: None\\r\\npatsy: None\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.9\\r\\nblosc: None\\r\\nbottleneck: None\\r\\ntables: 3.4.4\\r\\nnumexpr: 2.6.9\\r\\nfeather: None\\r\\nmatplotlib: 3.0.2\\r\\nopenpyxl: None\\r\\nxlrd: None\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml: None\\r\\nbs4: None\\r\\nhtml5lib: None\\r\\nsqlalchemy: 1.2.16\\r\\npymysql: None\\r\\npsycopg2: 2.7.6.1 (dt dec pq3 ext lo64)\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: 0.9.0\\r\\npandas_datareader: None\\r\\n</details>\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 1,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25506/comments',\n",
       "  'created_at': '2019-03-01T15:06:16Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25506/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25506',\n",
       "  'id': 416143779,\n",
       "  'labels': [{'color': '0b02e1',\n",
       "    'default': False,\n",
       "    'id': 2822098,\n",
       "    'name': 'Indexing',\n",
       "    'node_id': 'MDU6TGFiZWwyODIyMDk4',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Indexing'},\n",
       "   {'color': '5319e7',\n",
       "    'default': False,\n",
       "    'id': 60458168,\n",
       "    'name': 'Timezones',\n",
       "    'node_id': 'MDU6TGFiZWw2MDQ1ODE2OA==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Timezones'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25506/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYxNDM3Nzk=',\n",
       "  'number': 25506,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'BUG: Setting Timestamp with timezone with .at raises TypeError',\n",
       "  'updated_at': '2019-03-01T23:11:08Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25506',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/13486617?v=4',\n",
       "   'events_url': 'https://api.github.com/users/int8/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/int8/followers',\n",
       "   'following_url': 'https://api.github.com/users/int8/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/int8/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/int8',\n",
       "   'id': 13486617,\n",
       "   'login': 'int8',\n",
       "   'node_id': 'MDQ6VXNlcjEzNDg2NjE3',\n",
       "   'organizations_url': 'https://api.github.com/users/int8/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/int8/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/int8/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/int8/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/int8/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/int8'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': '- [ ] closes #25484 \\r\\n- [ ] tests added / passed\\r\\n- [ ] passes `git diff upstream/master -u -- \"*.py\" | flake8 --diff`\\r\\n- [ ] whatsnew entry\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 6,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25503/comments',\n",
       "  'created_at': '2019-03-01T13:42:30Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25503/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25503',\n",
       "  'id': 416108218,\n",
       "  'labels': [{'color': 'ffa0ff',\n",
       "    'default': False,\n",
       "    'id': 42670965,\n",
       "    'name': 'Error Reporting',\n",
       "    'node_id': 'MDU6TGFiZWw0MjY3MDk2NQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Error%20Reporting'},\n",
       "   {'color': '009800',\n",
       "    'default': False,\n",
       "    'id': 49182326,\n",
       "    'name': 'Sparse',\n",
       "    'node_id': 'MDU6TGFiZWw0OTE4MjMyNg==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Sparse'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25503/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 215,\n",
       "   'created_at': '2018-10-23T02:34:15Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': '',\n",
       "   'due_on': '2019-05-01T07:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/61',\n",
       "   'id': 3759483,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lMzc1OTQ4Mw==',\n",
       "   'number': 61,\n",
       "   'open_issues': 97,\n",
       "   'state': 'open',\n",
       "   'title': '0.25.0',\n",
       "   'updated_at': '2019-03-03T20:30:19Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61'},\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3NDQ3ODY0',\n",
       "  'number': 25503,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25503.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25503',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25503.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25503'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'BUG: User-facing AssertionError with add column to SparseDataFrame',\n",
       "  'updated_at': '2019-03-03T08:45:33Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25503',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/9269816?v=4',\n",
       "   'events_url': 'https://api.github.com/users/charlesdong1991/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/charlesdong1991/followers',\n",
       "   'following_url': 'https://api.github.com/users/charlesdong1991/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/charlesdong1991/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/charlesdong1991',\n",
       "   'id': 9269816,\n",
       "   'login': 'charlesdong1991',\n",
       "   'node_id': 'MDQ6VXNlcjkyNjk4MTY=',\n",
       "   'organizations_url': 'https://api.github.com/users/charlesdong1991/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/charlesdong1991/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/charlesdong1991/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/charlesdong1991/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/charlesdong1991/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/charlesdong1991'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': 'Uses the suggestion from #22276 and closes #22276.',\n",
       "  'closed_at': None,\n",
       "  'comments': 2,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25502/comments',\n",
       "  'created_at': '2019-03-01T13:02:21Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25502/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25502',\n",
       "  'id': 416093349,\n",
       "  'labels': [{'color': '3465A4',\n",
       "    'default': False,\n",
       "    'id': 134699,\n",
       "    'name': 'Docs',\n",
       "    'node_id': 'MDU6TGFiZWwxMzQ2OTk=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Docs'},\n",
       "   {'color': '5319e7',\n",
       "    'default': False,\n",
       "    'id': 47229171,\n",
       "    'name': 'IO CSV',\n",
       "    'node_id': 'MDU6TGFiZWw0NzIyOTE3MQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/IO%20CSV'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25502/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3NDM2MjEw',\n",
       "  'number': 25502,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25502.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25502',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25502.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25502'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'Update documentation of read_csv to explain that index_col can be a string containg a column name',\n",
       "  'updated_at': '2019-03-03T14:56:57Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25502',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/984760?v=4',\n",
       "   'events_url': 'https://api.github.com/users/kimsey0/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/kimsey0/followers',\n",
       "   'following_url': 'https://api.github.com/users/kimsey0/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/kimsey0/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/kimsey0',\n",
       "   'id': 984760,\n",
       "   'login': 'kimsey0',\n",
       "   'node_id': 'MDQ6VXNlcjk4NDc2MA==',\n",
       "   'organizations_url': 'https://api.github.com/users/kimsey0/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/kimsey0/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/kimsey0/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/kimsey0/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/kimsey0/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/kimsey0'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': '#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nimport sys\\r\\nif sys.version_info[0] < 3: \\r\\n    from StringIO import StringIO\\r\\nelse:\\r\\n    from io import StringIO\\r\\n\\r\\nimport pandas as pd\\r\\nimport csv\\r\\n\\r\\nescape_char_defined = \\'\\\\\\\\\\'\\r\\nquote_defined = \\'\"\\'\\r\\nseparator = \"|\"\\r\\n\\r\\nsample_data = []\\r\\n\\r\\nfor i in range(1,11):\\r\\n    sample_data.append(i*escape_char_defined + quote_defined)\\r\\n\\r\\ninitial_df = pd.DataFrame(sample_data,columns=[\\'column\\'])\\r\\n\\r\\n\\r\\ncsv_text = initial_df.to_csv(sep=separator,columns=None,header=None,index=False,doublequote=False,quoting=csv.QUOTE_ALL,quotechar=quote_defined,escapechar=escape_char_defined,encoding=\\'utf-8\\')\\r\\n\\r\\ncsv_text = StringIO(csv_text)\\r\\n\\r\\nfinal_df = pd.read_csv(csv_text,sep=separator,escapechar=escape_char_defined,quoting=csv.QUOTE_ALL,header=None,doublequote=False,encoding=\\'utf-8\\')\\r\\n\\r\\nif not final_df.equals(initial_df):\\r\\n    raise Exception(\"Dataframes are not equal!\")    \\r\\n\\r\\n```\\r\\n#### Problem description\\r\\n\\r\\nWhen defining several strings with an escape char before the quotechar, the same CSV generated by pandas is not read properly when transforming back to a pandas dataframe.\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\nThe dataframe written should be equal to the dataframe read.\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.6.4.final.0\\r\\npython-bits: 64\\r\\nOS: Windows\\r\\nOS-release: 10\\r\\nmachine: AMD64\\r\\nprocessor: Intel64 Family 6 Model 85 Stepping 4, GenuineIntel\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en\\r\\nLOCALE: None.None\\r\\n\\r\\npandas: 0.24.1\\r\\npytest: 3.3.2\\r\\npip: 9.0.1\\r\\nsetuptools: 38.4.0\\r\\nCython: 0.27.3\\r\\nnumpy: 1.14.0\\r\\nscipy: 1.0.0\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 6.2.1\\r\\nsphinx: 1.6.6\\r\\npatsy: 0.5.0\\r\\ndateutil: 2.6.1\\r\\npytz: 2017.3\\r\\nblosc: None\\r\\nbottleneck: 1.2.1\\r\\ntables: 3.4.2\\r\\nnumexpr: 2.6.4\\r\\nfeather: None\\r\\nmatplotlib: 2.1.2\\r\\nopenpyxl: 2.5.12\\r\\nxlrd: 1.1.0\\r\\nxlwt: 1.3.0\\r\\nxlsxwriter: 1.0.2\\r\\nlxml.etree: 4.1.1\\r\\nbs4: 4.6.0\\r\\nhtml5lib: 1.0.1\\r\\nsqlalchemy: 1.1.18\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.8.1\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25501/comments',\n",
       "  'created_at': '2019-03-01T12:23:17Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25501/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25501',\n",
       "  'id': 416079697,\n",
       "  'labels': [],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25501/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYwNzk2OTc=',\n",
       "  'number': 25501,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': \".read_csv() isn't reading escape characters properly\",\n",
       "  'updated_at': '2019-03-01T12:23:17Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25501',\n",
       "  'user': {'avatar_url': 'https://avatars1.githubusercontent.com/u/4515493?v=4',\n",
       "   'events_url': 'https://api.github.com/users/jelther/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/jelther/followers',\n",
       "   'following_url': 'https://api.github.com/users/jelther/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/jelther/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/jelther',\n",
       "   'id': 4515493,\n",
       "   'login': 'jelther',\n",
       "   'node_id': 'MDQ6VXNlcjQ1MTU0OTM=',\n",
       "   'organizations_url': 'https://api.github.com/users/jelther/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/jelther/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/jelther/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/jelther/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/jelther/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/jelther'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': \"Hi, first of all thanks for the amazing library everyone!\\r\\n\\r\\nThis is a minor issue I'm sure, but I find it impossible to remember the name of the `.pct_change()` function.\\r\\n\\r\\nPartly this is because of confusion with the existing .diff() function which is easy to remember - I always try things like:\\r\\n- pctdiff()\\r\\n- pct_diff()\\r\\n- percent_diff()\\r\\n\\r\\nNormally after a couple of goes I admit defeat and Google it yet again :)\\r\\n\\r\\nSo this is a request for an additional function with the name `.pct_diff()` (or whatever spelling is preferred) that replicates/calls `.pct_change()`, in order to standardise the API.\\r\\n\\r\\nThanks!\",\n",
       "  'closed_at': None,\n",
       "  'comments': 3,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25500/comments',\n",
       "  'created_at': '2019-03-01T11:40:29Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25500/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25500',\n",
       "  'id': 416064987,\n",
       "  'labels': [{'color': 'AD7FA8',\n",
       "    'default': False,\n",
       "    'id': 35818298,\n",
       "    'name': 'API Design',\n",
       "    'node_id': 'MDU6TGFiZWwzNTgxODI5OA==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/API%20Design'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25500/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYwNjQ5ODc=',\n",
       "  'number': 25500,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': '(api) function names: pct_change, diff',\n",
       "  'updated_at': '2019-03-01T17:34:32Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25500',\n",
       "  'user': {'avatar_url': 'https://avatars2.githubusercontent.com/u/5629061?v=4',\n",
       "   'events_url': 'https://api.github.com/users/hottwaj/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/hottwaj/followers',\n",
       "   'following_url': 'https://api.github.com/users/hottwaj/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/hottwaj/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/hottwaj',\n",
       "   'id': 5629061,\n",
       "   'login': 'hottwaj',\n",
       "   'node_id': 'MDQ6VXNlcjU2MjkwNjE=',\n",
       "   'organizations_url': 'https://api.github.com/users/hottwaj/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/hottwaj/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/hottwaj/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/hottwaj/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/hottwaj/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/hottwaj'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'MEMBER',\n",
       "  'body': \"#### Code Sample, a copy-pastable example if possible\\r\\nxref #25485 \\r\\n```python\\r\\nIn [1]: import numpy as np; import pandas as pd; pd.__version__\\r\\nOut[1]: '0.25.0.dev0+180.g016141d'\\r\\n\\r\\nIn [2]: iv = pd.Interval(pd.Timestamp.min, pd.Timestamp.max)\\r\\n\\r\\nIn [3]: ii = pd.IntervalIndex([iv])\\r\\n\\r\\nIn [4]: ii.length\\r\\n---------------------------------------------------------------------------\\r\\nOverflowError: Overflow in int64 addition\\r\\n\\r\\nIn [5]: ii.mid\\r\\n---------------------------------------------------------------------------\\r\\nOverflowError: Overflow in int64 addition\\r\\n```\\r\\nNote that these operations work on the `Interval` object itself, albeit with the length being cast to `datetime.timedelta`:\\r\\n```python\\r\\nIn [6]: iv.length\\r\\nOut[6]: datetime.timedelta(213503, 84873, 709550)\\r\\n\\r\\nIn [7]: iv.mid\\r\\nOut[7]: Timestamp('1970-01-01 00:00:00')\\r\\n```\\r\\n\\r\\nMore generally, this can silently occur with integer endpoints.  For example with `mid`:\\r\\n```python\\r\\nIn [8]: ii64 = np.iinfo(np.int64)                                                                                           \\r\\n\\r\\nIn [9]: iv2 = pd.Interval(ii64.max - 1, ii64.max)                                                                           \\r\\n\\r\\nIn [10]: ii2 = pd.IntervalIndex([iv2])                                                                                      \\r\\n\\r\\nIn [11]: ii2.mid                                                                                                            \\r\\nOut[11]: Float64Index([-1.5], dtype='float64')\\r\\n\\r\\nIn [12]: iv2.mid                                                                                                            \\r\\nOut[12]: 9.223372036854776e+18\\r\\n```\\r\\n\\r\\nAnd with `length`:\\r\\n```python\\r\\nIn [13]: iv3 = pd.Interval(ii64.min, ii64.max)                                                                              \\r\\n\\r\\nIn [14]: ii3 = pd.IntervalIndex([iv3])                                                                                      \\r\\n\\r\\nIn [15]: ii3.length                                                                                                         \\r\\nOut[15]: Int64Index([-1], dtype='int64')\\r\\n\\r\\nIn [16]: iv3.length                                                                                                         \\r\\nOut[16]: 18446744073709551615\\r\\n```\\r\\nNote that all examples above have the same behavior with `IntervalArray` in place of `IntervalIndex`.\\r\\n\\r\\n#### Problem description\\r\\n`IntervalIndex` and `IntervalArray` implementations can cause an `OverflowError`, with the overflow sometimes occurring silently.\\r\\n\\r\\n#### Expected Output\\r\\nIt might be possible to for `Out[5]` to return the correct value with a different implementation.\\r\\n\\r\\nI'm not sure how much can be done for the other errors given that the correct values are out of bounds for their given dtype.  For the integer examples it may be possible to get the correct answer by having the output be an array of `uint64` dtype , but I'm not sure off the top of my head how that would be implemented.\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: 016141d057cd828b42cfa8804d0c37f712b6ed24\\r\\npython: 3.6.8.final.0\\r\\npython-bits: 64\\r\\nOS: Linux\\r\\nOS-release: 4.14.29-galliumos\\r\\nmachine: x86_64\\r\\nprocessor: x86_64\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en_US.UTF-8\\r\\nLOCALE: en_US.UTF-8\\r\\n\\r\\npandas: 0.25.0.dev0+180.g016141d\\r\\npytest: 4.0.2\\r\\npip: 18.1\\r\\nsetuptools: 40.6.3\\r\\nCython: 0.28.3\\r\\nnumpy: 1.14.5\\r\\nscipy: None\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 7.2.0\\r\\nsphinx: 1.8.2\\r\\npatsy: None\\r\\ndateutil: 2.7.3\\r\\npytz: 2018.4\\r\\nblosc: None\\r\\nbottleneck: None\\r\\ntables: None\\r\\nnumexpr: None\\r\\nfeather: None\\r\\nmatplotlib: 3.0.2\\r\\nopenpyxl: None\\r\\nxlrd: None\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml.etree: None\\r\\nbs4: None\\r\\nhtml5lib: None\\r\\nsqlalchemy: None\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n\\r\\n</details>\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25499/comments',\n",
       "  'created_at': '2019-03-01T08:54:17Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25499/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25499',\n",
       "  'id': 416001346,\n",
       "  'labels': [{'color': '009800',\n",
       "    'default': False,\n",
       "    'id': 150096370,\n",
       "    'name': 'Interval',\n",
       "    'node_id': 'MDU6TGFiZWwxNTAwOTYzNzA=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Interval'},\n",
       "   {'color': '006b75',\n",
       "    'default': False,\n",
       "    'id': 47223669,\n",
       "    'name': 'Numeric',\n",
       "    'node_id': 'MDU6TGFiZWw0NzIyMzY2OQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Numeric'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25499/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYwMDEzNDY=',\n",
       "  'number': 25499,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'BUG: Overflow in IntervalIndex/IntervalArray mid/length',\n",
       "  'updated_at': '2019-03-01T08:54:17Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25499',\n",
       "  'user': {'avatar_url': 'https://avatars3.githubusercontent.com/u/5332445?v=4',\n",
       "   'events_url': 'https://api.github.com/users/jschendel/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/jschendel/followers',\n",
       "   'following_url': 'https://api.github.com/users/jschendel/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/jschendel/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/jschendel',\n",
       "   'id': 5332445,\n",
       "   'login': 'jschendel',\n",
       "   'node_id': 'MDQ6VXNlcjUzMzI0NDU=',\n",
       "   'organizations_url': 'https://api.github.com/users/jschendel/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/jschendel/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/jschendel/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/jschendel/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/jschendel/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/jschendel'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': '#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nimport pandas as pd\\r\\ntd = pd.Timedelta(\\'1 days\\')\\r\\ndti = pd.date_range(\\'20130101\\', periods=3, name=\\'bar\\')\\r\\ntd - dti\\r\\n```\\r\\n#### Problem description\\r\\n\\r\\n\\r\\n0.25.0.dev0+179.g0a61ecdf6\\r\\n\\r\\n```python-traceback\\r\\nTraceback (most recent call last):\\r\\n  File \"<stdin>\", line 1, in <module>\\r\\n  File \"C:\\\\Users\\\\simon\\\\OneDrive\\\\code\\\\pandas-simonjayhawkins\\\\pandas\\\\core\\\\indexes\\\\datetimelike.py\", line 507, in __rsub__\\r\\n    result = self._data.__rsub__(maybe_unwrap_index(other))\\r\\n  File \"C:\\\\Users\\\\simon\\\\OneDrive\\\\code\\\\pandas-simonjayhawkins\\\\pandas\\\\core\\\\arrays\\\\datetimelike.py\", line 1325, in __rsub__\\r\\n    return -(self - other)\\r\\nTypeError: bad operand type for unary -: \\'DatetimeArray\\'\\r\\n```\\r\\n#### Expected Output\\r\\n\\r\\nsame as 0.23.4\\r\\n\\r\\n```python-traceback\\r\\n---------------------------------------------------------------------------\\r\\nTypeError                                 Traceback (most recent call last)\\r\\n<ipython-input-2-2a4f19a48f3e> in <module>\\r\\n      3 td = pd.Timedelta(\\'1 days\\')\\r\\n      4 dti = pd.date_range(\\'20130101\\', periods=3, name=\\'bar\\')\\r\\n----> 5 td - dti\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\indexes\\\\datetimelike.py in __rsub__(self, other)\\r\\n    949                 from pandas import DatetimeIndex\\r\\n    950                 return DatetimeIndex(other) - self\\r\\n--> 951             return -(self - other)\\r\\n    952         cls.__rsub__ = __rsub__\\r\\n    953 \\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\ops.py in invalid_op(self, other)\\r\\n    174     def invalid_op(self, other=None):\\r\\n    175         raise TypeError(\"cannot perform {name} with this index type: \"\\r\\n--> 176                         \"{typ}\".format(name=name, typ=type(self).__name__))\\r\\n    177 \\r\\n    178     invalid_op.__name__ = name\\r\\n\\r\\nTypeError: cannot perform __neg__ with this index type: DatetimeIndex\\r\\n```\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: 0a61ecdf6b4ea61a67afb4e3862df79adc07053a\\r\\npython: 3.7.2.final.0\\r\\npython-bits: 64\\r\\nOS: Windows\\r\\nOS-release: 10\\r\\nmachine: AMD64\\r\\nprocessor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en_US.UTF-8\\r\\nLOCALE: None.None\\r\\n\\r\\npandas: 0.25.0.dev0+179.g0a61ecdf6\\r\\npytest: 4.2.0\\r\\npip: 19.0.1\\r\\nsetuptools: 40.8.0\\r\\nCython: 0.29.5\\r\\nnumpy: 1.15.4\\r\\nscipy: 1.2.1\\r\\npyarrow: 0.11.1\\r\\nxarray: 0.11.3\\r\\nIPython: 7.2.0\\r\\nsphinx: 1.8.4\\r\\npatsy: 0.5.1\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.9\\r\\nblosc: None\\r\\nbottleneck: 1.2.1\\r\\ntables: 3.4.4\\r\\nnumexpr: 2.6.9\\r\\nfeather: None\\r\\nmatplotlib: 3.0.2\\r\\nopenpyxl: 2.6.0\\r\\nxlrd: 1.2.0\\r\\nxlwt: 1.3.0\\r\\nxlsxwriter: 1.1.2\\r\\nlxml.etree: 4.3.1\\r\\nbs4: 4.7.1\\r\\nhtml5lib: 1.0.1\\r\\nsqlalchemy: 1.2.18\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: 0.2.0\\r\\nfastparquet: 0.2.1\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25497/comments',\n",
       "  'created_at': '2019-03-01T08:50:26Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25497/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25497',\n",
       "  'id': 416000063,\n",
       "  'labels': [{'color': 'ffa0ff',\n",
       "    'default': False,\n",
       "    'id': 42670965,\n",
       "    'name': 'Error Reporting',\n",
       "    'node_id': 'MDU6TGFiZWw0MjY3MDk2NQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Error%20Reporting'},\n",
       "   {'color': '5319e7',\n",
       "    'default': False,\n",
       "    'id': 49597148,\n",
       "    'name': 'Timedelta',\n",
       "    'node_id': 'MDU6TGFiZWw0OTU5NzE0OA==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Timedelta'},\n",
       "   {'color': 'AFEEEE',\n",
       "    'default': False,\n",
       "    'id': 211840,\n",
       "    'name': 'Timeseries',\n",
       "    'node_id': 'MDU6TGFiZWwyMTE4NDA=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25497/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTYwMDAwNjM=',\n",
       "  'number': 25497,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'regression in error message for DatetimeIndex subtraction',\n",
       "  'updated_at': '2019-03-01T23:12:11Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25497',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/13159005?v=4',\n",
       "   'events_url': 'https://api.github.com/users/simonjayhawkins/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/simonjayhawkins/followers',\n",
       "   'following_url': 'https://api.github.com/users/simonjayhawkins/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/simonjayhawkins/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/simonjayhawkins',\n",
       "   'id': 13159005,\n",
       "   'login': 'simonjayhawkins',\n",
       "   'node_id': 'MDQ6VXNlcjEzMTU5MDA1',\n",
       "   'organizations_url': 'https://api.github.com/users/simonjayhawkins/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/simonjayhawkins/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/simonjayhawkins/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/simonjayhawkins/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/simonjayhawkins'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': \"#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nIn [1]: import pandas as pd\\r\\n\\r\\nIn [2]: df = pd.DataFrame({'Alpha': [u'a'], 'Numeric': [0]})\\r\\n\\r\\nIn [3]: df.loc[:,'Alpha']\\r\\nOut[3]: \\r\\n0    a\\r\\nName: Alpha, dtype: object\\r\\n\\r\\nIn [4]: codes = pd.Categorical(df['Alpha'], categories = [u'a',u'b',u'c'])\\r\\n\\r\\nIn [5]: codes\\r\\nOut[5]: \\r\\n[a]\\r\\nCategories (3, object): [a, b, c]\\r\\n\\r\\nIn [6]: df.loc[:,'Alpha'] = codes\\r\\n\\r\\nIn [7]: df.loc[:,'Alpha']\\r\\nOut[7]: \\r\\n0    a\\r\\nName: Alpha, dtype: object\\r\\n```\\r\\n\\r\\n#### Problem description\\r\\n\\r\\nWhen I try to set the column of a one-row DataFrame to a `pandas.core.arrays.categorical.Categorical`, it is returned as a `pandas.core.series.Series` of `dtype('O')` rather than a `pandas.core.series.Series` of `CategoricalDtype(categories=[u'a', u'b', u'c'], ordered=False)`. I get the latter return value when I set the column using `df['Alpha'] = codes` or `df.Alpha = codes`. I can't replicate this inconsistency with DataFrames containing more than one row.\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\n```python\\r\\nOut[7]: \\r\\n0    a\\r\\nName: Alpha, dtype: category\\r\\nCategories (3, object): [a, b, c]\\r\\n```\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\n[paste the output of ``pd.show_versions()`` here below this line]\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 2.7.15.final.0\\r\\npython-bits: 64\\r\\nOS: Darwin\\r\\nOS-release: 18.2.0\\r\\nmachine: x86_64\\r\\nprocessor: i386\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: en_US.UTF-8\\r\\nLOCALE: None.None\\r\\n\\r\\npandas: 0.24.1\\r\\npytest: None\\r\\npip: 19.0.3\\r\\nsetuptools: 40.6.3\\r\\nCython: None\\r\\nnumpy: 1.15.4\\r\\nscipy: 1.2.0\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 5.8.0\\r\\nsphinx: None\\r\\npatsy: 0.5.1\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.7\\r\\nblosc: None\\r\\nbottleneck: None\\r\\ntables: None\\r\\nnumexpr: None\\r\\nfeather: None\\r\\nmatplotlib: 2.2.3\\r\\nopenpyxl: None\\r\\nxlrd: None\\r\\nxlwt: None\\r\\nxlsxwriter: None\\r\\nlxml.etree: None\\r\\nbs4: None\\r\\nhtml5lib: None\\r\\nsqlalchemy: None\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\ngcsfs: None\\r\\n</details>\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 0,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25495/comments',\n",
       "  'created_at': '2019-03-01T05:27:46Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25495/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25495',\n",
       "  'id': 415947681,\n",
       "  'labels': [],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25495/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTU5NDc2ODE=',\n",
       "  'number': 25495,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'Unexpected dtype when using .loc to set Categorical value for column in 1-row DataFrame',\n",
       "  'updated_at': '2019-03-01T05:27:46Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25495',\n",
       "  'user': {'avatar_url': 'https://avatars2.githubusercontent.com/u/3424695?v=4',\n",
       "   'events_url': 'https://api.github.com/users/mbcole/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/mbcole/followers',\n",
       "   'following_url': 'https://api.github.com/users/mbcole/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/mbcole/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/mbcole',\n",
       "   'id': 3424695,\n",
       "   'login': 'mbcole',\n",
       "   'node_id': 'MDQ6VXNlcjM0MjQ2OTU=',\n",
       "   'organizations_url': 'https://api.github.com/users/mbcole/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/mbcole/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/mbcole/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/mbcole/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/mbcole/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/mbcole'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': 'closes #19129\\r\\ncloses #22525\\r\\n- [ ] tests added / passed\\r\\n- [ ] passes `git diff upstream/master -u -- \"*.py\" | flake8 --diff`\\r\\n- [ ] whatsnew entry\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 4,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25488/comments',\n",
       "  'created_at': '2019-02-28T23:31:01Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25488/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/pull/25488',\n",
       "  'id': 415871553,\n",
       "  'labels': [{'color': '207de5',\n",
       "    'default': False,\n",
       "    'id': 49379259,\n",
       "    'name': 'IO JSON',\n",
       "    'node_id': 'MDU6TGFiZWw0OTM3OTI1OQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/IO%20JSON'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25488/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDExOlB1bGxSZXF1ZXN0MjU3MjY2OTYz',\n",
       "  'number': 25488,\n",
       "  'pull_request': {'diff_url': 'https://github.com/pandas-dev/pandas/pull/25488.diff',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/pull/25488',\n",
       "   'patch_url': 'https://github.com/pandas-dev/pandas/pull/25488.patch',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/pulls/25488'},\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': \"Fix JSON orient='table' issues with numeric column names\",\n",
       "  'updated_at': '2019-03-03T13:45:49Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25488',\n",
       "  'user': {'avatar_url': 'https://avatars3.githubusercontent.com/u/8515462?v=4',\n",
       "   'events_url': 'https://api.github.com/users/albertvillanova/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/albertvillanova/followers',\n",
       "   'following_url': 'https://api.github.com/users/albertvillanova/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/albertvillanova/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/albertvillanova',\n",
       "   'id': 8515462,\n",
       "   'login': 'albertvillanova',\n",
       "   'node_id': 'MDQ6VXNlcjg1MTU0NjI=',\n",
       "   'organizations_url': 'https://api.github.com/users/albertvillanova/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/albertvillanova/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/albertvillanova/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/albertvillanova/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/albertvillanova/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/albertvillanova'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': \"see also #5289\\r\\n\\r\\n#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nimport numpy as np\\r\\nimport pandas as pd\\r\\ndata = {'A': [np.nan, np.nan, np.nan, 0, 1, 2, 3, 4, 5, 6],\\r\\n        'B': [0, 1, 2, np.nan, np.nan, np.nan, 3, 4, 5, 6],\\r\\n        'C': np.arange(10, dtype=np.float64),\\r\\n        'D': [0, 1, 2, 3, 4, 5, np.nan, np.nan, np.nan, np.nan]}\\r\\ndates = pd.bdate_range('1/1/2011', periods=10)\\r\\nfloat_frame = pd.SparseDataFrame(data, index=dates, default_kind='block')\\r\\nN = len(float_frame)\\r\\nfloat_frame['foo'] = np.random.randn(N - 1)\\r\\n```\\r\\n#### Problem description\\r\\n\\r\\n```python-traceback\\r\\n---------------------------------------------------------------------------\\r\\nAssertionError                            Traceback (most recent call last)\\r\\n<ipython-input-8-0a4f051f0d7a> in <module>\\r\\n      8 float_frame = pd.SparseDataFrame(data, index=dates, default_kind='block')\\r\\n      9 N = len(float_frame)\\r\\n---> 10 float_frame['foo'] = np.random.randn(N - 1)\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\frame.py in __setitem__(self, key, value)\\r\\n   3117         else:\\r\\n   3118             # set column\\r\\n-> 3119             self._set_item(key, value)\\r\\n   3120 \\r\\n   3121     def _setitem_slice(self, key, value):\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\frame.py in _set_item(self, key, value)\\r\\n   3192 \\r\\n   3193         self._ensure_valid_index(value)\\r\\n-> 3194         value = self._sanitize_column(key, value)\\r\\n   3195         NDFrame._set_item(self, key, value)\\r\\n   3196 \\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\core\\\\sparse\\\\frame.py in _sanitize_column(self, key, value, **kwargs)\\r\\n    418             else:\\r\\n    419                 if len(value) != len(self.index):\\r\\n--> 420                     raise AssertionError('Length of values does not match '\\r\\n    421                                          'length of index')\\r\\n    422                 clean = sp_maker(value)\\r\\n\\r\\nAssertionError: Length of values does not match length of index\\r\\n```\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\n```python-traceback\\r\\nValueError: Length of values does not match length of index\\r\\n```\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.7.1.final.0\\r\\npython-bits: 64\\r\\nOS: Windows\\r\\nOS-release: 10\\r\\nmachine: AMD64\\r\\nprocessor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: None\\r\\nLOCALE: None.None\\r\\n\\r\\npandas: 0.23.4\\r\\npytest: 4.0.2\\r\\npip: 18.1\\r\\nsetuptools: 40.6.3\\r\\nCython: 0.29.2\\r\\nnumpy: 1.15.4\\r\\nscipy: 1.1.0\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 7.2.0\\r\\nsphinx: 1.8.2\\r\\npatsy: 0.5.1\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.7\\r\\nblosc: None\\r\\nbottleneck: 1.2.1\\r\\ntables: 3.4.4\\r\\nnumexpr: 2.6.8\\r\\nfeather: None\\r\\nmatplotlib: 3.0.2\\r\\nopenpyxl: 2.5.12\\r\\nxlrd: 1.2.0\\r\\nxlwt: 1.3.0\\r\\nxlsxwriter: 1.1.2\\r\\nlxml: 4.2.5\\r\\nbs4: 4.6.3\\r\\nhtml5lib: 1.0.1\\r\\nsqlalchemy: 1.2.15\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\n</details>\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 1,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25484/comments',\n",
       "  'created_at': '2019-02-28T20:28:53Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25484/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25484',\n",
       "  'id': 415809067,\n",
       "  'labels': [{'color': 'ffa0ff',\n",
       "    'default': False,\n",
       "    'id': 42670965,\n",
       "    'name': 'Error Reporting',\n",
       "    'node_id': 'MDU6TGFiZWw0MjY3MDk2NQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Error%20Reporting'},\n",
       "   {'color': '009800',\n",
       "    'default': False,\n",
       "    'id': 49182326,\n",
       "    'name': 'Sparse',\n",
       "    'node_id': 'MDU6TGFiZWw0OTE4MjMyNg==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Sparse'},\n",
       "   {'color': '0e8a16',\n",
       "    'default': True,\n",
       "    'id': 717120670,\n",
       "    'name': 'good first issue',\n",
       "    'node_id': 'MDU6TGFiZWw3MTcxMjA2NzA=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25484/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 215,\n",
       "   'created_at': '2018-10-23T02:34:15Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': '',\n",
       "   'due_on': '2019-05-01T07:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/61',\n",
       "   'id': 3759483,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lMzc1OTQ4Mw==',\n",
       "   'number': 61,\n",
       "   'open_issues': 97,\n",
       "   'state': 'open',\n",
       "   'title': '0.25.0',\n",
       "   'updated_at': '2019-03-03T20:30:19Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/61'},\n",
       "  'node_id': 'MDU6SXNzdWU0MTU4MDkwNjc=',\n",
       "  'number': 25484,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'BUG: User-facing AssertionError with add column to SparseDataFrame',\n",
       "  'updated_at': '2019-03-03T01:56:37Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25484',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/13159005?v=4',\n",
       "   'events_url': 'https://api.github.com/users/simonjayhawkins/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/simonjayhawkins/followers',\n",
       "   'following_url': 'https://api.github.com/users/simonjayhawkins/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/simonjayhawkins/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/simonjayhawkins',\n",
       "   'id': 13159005,\n",
       "   'login': 'simonjayhawkins',\n",
       "   'node_id': 'MDQ6VXNlcjEzMTU5MDA1',\n",
       "   'organizations_url': 'https://api.github.com/users/simonjayhawkins/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/simonjayhawkins/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/simonjayhawkins/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/simonjayhawkins/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/simonjayhawkins'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'CONTRIBUTOR',\n",
       "  'body': 'see also https://github.com/pandas-dev/pandas/issues/17372#issuecomment-325759975\\r\\n\\r\\n#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\nimport pandas as pd\\r\\ndf = pd.DataFrame({\\'A\\': [\"x\", \"y\", \"z\"], \\'B\\': [1, 2, 3]})\\r\\ndf[\\'A\\'].plot()\\r\\n```\\r\\n#### Problem description\\r\\n\\r\\n```python-traceback\\r\\n---------------------------------------------------------------------------\\r\\nTypeError                                 Traceback (most recent call last)\\r\\n<ipython-input-4-06628911498f> in <module>\\r\\n      1 import pandas as pd\\r\\n      2 df = pd.DataFrame({\\'A\\': [\"x\", \"y\", \"z\"], \\'B\\': [1, 2, 3]})\\r\\n----> 3 df[\\'A\\'].plot()\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\plotting\\\\_core.py in __call__(self, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)\\r\\n   2739                            colormap=colormap, table=table, yerr=yerr,\\r\\n   2740                            xerr=xerr, label=label, secondary_y=secondary_y,\\r\\n-> 2741                            **kwds)\\r\\n   2742     __call__.__doc__ = plot_series.__doc__\\r\\n   2743 \\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\plotting\\\\_core.py in plot_series(data, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)\\r\\n   2000                  yerr=yerr, xerr=xerr,\\r\\n   2001                  label=label, secondary_y=secondary_y,\\r\\n-> 2002                  **kwds)\\r\\n   2003 \\r\\n   2004 \\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\plotting\\\\_core.py in _plot(data, x, y, subplots, ax, kind, **kwds)\\r\\n   1802         plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)\\r\\n   1803 \\r\\n-> 1804     plot_obj.generate()\\r\\n   1805     plot_obj.draw()\\r\\n   1806     return plot_obj.result\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\plotting\\\\_core.py in generate(self)\\r\\n    256     def generate(self):\\r\\n    257         self._args_adjust()\\r\\n--> 258         self._compute_plot_data()\\r\\n    259         self._setup_subplots()\\r\\n    260         self._make_plot()\\r\\n\\r\\n~\\\\Anaconda3\\\\lib\\\\site-packages\\\\pandas\\\\plotting\\\\_core.py in _compute_plot_data(self)\\r\\n    371         if is_empty:\\r\\n    372             raise TypeError(\\'Empty {0!r}: no numeric data to \\'\\r\\n--> 373                             \\'plot\\'.format(numeric_data.__class__.__name__))\\r\\n    374 \\r\\n    375         self.data = numeric_data\\r\\n\\r\\nTypeError: Empty \\'DataFrame\\': no numeric data to plot\\r\\n```\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\n```python-traceback\\r\\nTypeError: no numeric data to plot\\r\\n```\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\nINSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.7.1.final.0\\r\\npython-bits: 64\\r\\nOS: Windows\\r\\nOS-release: 10\\r\\nmachine: AMD64\\r\\nprocessor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: None\\r\\nLOCALE: None.None\\r\\n\\r\\npandas: 0.23.4\\r\\npytest: 4.0.2\\r\\npip: 18.1\\r\\nsetuptools: 40.6.3\\r\\nCython: 0.29.2\\r\\nnumpy: 1.15.4\\r\\nscipy: 1.1.0\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 7.2.0\\r\\nsphinx: 1.8.2\\r\\npatsy: 0.5.1\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.7\\r\\nblosc: None\\r\\nbottleneck: 1.2.1\\r\\ntables: 3.4.4\\r\\nnumexpr: 2.6.8\\r\\nfeather: None\\r\\nmatplotlib: 3.0.2\\r\\nopenpyxl: 2.5.12\\r\\nxlrd: 1.2.0\\r\\nxlwt: 1.3.0\\r\\nxlsxwriter: 1.1.2\\r\\nlxml: 4.2.5\\r\\nbs4: 4.6.3\\r\\nhtml5lib: 1.0.1\\r\\nsqlalchemy: 1.2.15\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\n\\r\\n</details>\\r\\n',\n",
       "  'closed_at': None,\n",
       "  'comments': 2,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25481/comments',\n",
       "  'created_at': '2019-02-28T19:23:04Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25481/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25481',\n",
       "  'id': 415783892,\n",
       "  'labels': [{'color': 'ffa0ff',\n",
       "    'default': False,\n",
       "    'id': 42670965,\n",
       "    'name': 'Error Reporting',\n",
       "    'node_id': 'MDU6TGFiZWw0MjY3MDk2NQ==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Error%20Reporting'},\n",
       "   {'color': '8AE234',\n",
       "    'default': False,\n",
       "    'id': 2413328,\n",
       "    'name': 'Visualization',\n",
       "    'node_id': 'MDU6TGFiZWwyNDEzMzI4',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Visualization'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25481/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTU3ODM4OTI=',\n",
       "  'number': 25481,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'BUG: confusing error message for DataFrame.plot()',\n",
       "  'updated_at': '2019-03-01T01:40:10Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25481',\n",
       "  'user': {'avatar_url': 'https://avatars0.githubusercontent.com/u/13159005?v=4',\n",
       "   'events_url': 'https://api.github.com/users/simonjayhawkins/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/simonjayhawkins/followers',\n",
       "   'following_url': 'https://api.github.com/users/simonjayhawkins/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/simonjayhawkins/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/simonjayhawkins',\n",
       "   'id': 13159005,\n",
       "   'login': 'simonjayhawkins',\n",
       "   'node_id': 'MDQ6VXNlcjEzMTU5MDA1',\n",
       "   'organizations_url': 'https://api.github.com/users/simonjayhawkins/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/simonjayhawkins/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/simonjayhawkins/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/simonjayhawkins/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/simonjayhawkins'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': \"#### Code Sample, a copy-pastable example if possible\\r\\n\\r\\n```python\\r\\ndef getHourOfTime(myString):\\r\\n    return int(myString[0:2:1])\\r\\n\\r\\nimport pandas as pd    \\r\\nimport numpy as np   \\r\\ne = np.random.randint(24, size=100)  \\r\\ne_dataframe = pd.DataFrame(e)      \\r\\ne_dataframe = e_dataframe.rename(index=str, columns={0:'Time_x'})\\r\\n\\r\\n\\r\\nx=e_dataframe\\r\\nx['hour'] = e_dataframe['Time_x'].dropna().apply(lambda x: getHourOfTime(str(x)))\\r\\n\\r\\ndisplay(x['hour'].head(10))\\r\\n\\r\\nx['TimeCategory']= pd.cut(x['hour'],bins=[0,6, 9, 16, 19, 24], \\r\\n                   labels=['MORNING', 'MPH', 'DAY', 'EPH', 'NIGHT'],\\r\\n                   include_lowest=True)\\r\\n\\r\\nx['TimeCategory'] = x['TimeCategory'].replace('MORNING', 'NIGHT')\\r\\n\\r\\nfdf = x[x['TimeCategory'] != 'MORNING']\\r\\n\\r\\ndisplay(x[x['TimeCategory'] != 'MORNING'].head(5))\\r\\n\\r\\nfdf['TimeCategory'].value_counts()\\r\\n\\r\\n```\\r\\n#### Problem description\\r\\nAfter replace, value_counts() count MORNING category label\\r\\n\\r\\nDAY        59046\\r\\nEPH        29039\\r\\nNIGHT      25687\\r\\nMPH        22847\\r\\nMORNING        0\\r\\n\\r\\n\\xa0 | Time_x | hour | TimeCategory\\r\\n-- | -- | -- | --\\r\\n14 | 14 | DAY\\r\\n23 | 23 | NIGHT\\r\\n11 | 11 | DAY\\r\\n1 | 1 | NIGHT\\r\\n7 | 7 | MPH\\r\\n\\r\\n\\r\\n\\r\\nI have install all the latest versions of panda, numpy, jupyter notebooks, et.c\\r\\n\\r\\n#### Expected Output\\r\\n\\r\\nDAY        59046\\r\\nEPH        29039\\r\\nNIGHT      25687\\r\\nMPH        22847\\r\\n\\r\\n\\r\\n#### Output of ``pd.show_versions()``\\r\\n\\r\\n<details>\\r\\n\\r\\n[paste the output of ``pd.show_versions()`` here below this line]\\r\\nNSTALLED VERSIONS\\r\\n------------------\\r\\ncommit: None\\r\\npython: 3.7.1.final.0\\r\\npython-bits: 64\\r\\nOS: Windows\\r\\nOS-release: 10\\r\\nmachine: AMD64\\r\\nprocessor: Intel64 Family 6 Model 142 Stepping 9, GenuineIntel\\r\\nbyteorder: little\\r\\nLC_ALL: None\\r\\nLANG: None\\r\\nLOCALE: None.None\\r\\n\\r\\npandas: 0.23.4\\r\\npytest: 4.0.2\\r\\npip: 18.1\\r\\nsetuptools: 40.6.3\\r\\nCython: 0.29.2\\r\\nnumpy: 1.15.4\\r\\nscipy: 1.2.1\\r\\npyarrow: None\\r\\nxarray: None\\r\\nIPython: 7.2.0\\r\\nsphinx: 1.8.2\\r\\npatsy: 0.5.1\\r\\ndateutil: 2.7.5\\r\\npytz: 2018.7\\r\\nblosc: None\\r\\nbottleneck: 1.2.1\\r\\ntables: 3.4.4\\r\\nnumexpr: 2.6.8\\r\\nfeather: None\\r\\nmatplotlib: 3.0.2\\r\\nopenpyxl: 2.5.12\\r\\nxlrd: 1.2.0\\r\\nxlwt: 1.3.0\\r\\nxlsxwriter: 1.1.2\\r\\nlxml: 4.2.5\\r\\nbs4: 4.6.3\\r\\nhtml5lib: 1.0.1\\r\\nsqlalchemy: 1.2.15\\r\\npymysql: None\\r\\npsycopg2: None\\r\\njinja2: 2.10\\r\\ns3fs: None\\r\\nfastparquet: None\\r\\npandas_gbq: None\\r\\npandas_datareader: None\\r\\n</details>\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 1,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25476/comments',\n",
       "  'created_at': '2019-02-28T13:44:43Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25476/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25476',\n",
       "  'id': 415630410,\n",
       "  'labels': [],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25476/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': None,\n",
       "  'node_id': 'MDU6SXNzdWU0MTU2MzA0MTA=',\n",
       "  'number': 25476,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'value_counts() counting wrong categories',\n",
       "  'updated_at': '2019-02-28T14:21:34Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25476',\n",
       "  'user': {'avatar_url': 'https://avatars2.githubusercontent.com/u/5226972?v=4',\n",
       "   'events_url': 'https://api.github.com/users/npfernandeztheillet/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/npfernandeztheillet/followers',\n",
       "   'following_url': 'https://api.github.com/users/npfernandeztheillet/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/npfernandeztheillet/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/npfernandeztheillet',\n",
       "   'id': 5226972,\n",
       "   'login': 'npfernandeztheillet',\n",
       "   'node_id': 'MDQ6VXNlcjUyMjY5NzI=',\n",
       "   'organizations_url': 'https://api.github.com/users/npfernandeztheillet/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/npfernandeztheillet/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/npfernandeztheillet/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/npfernandeztheillet/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/npfernandeztheillet/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/npfernandeztheillet'}},\n",
       " {'assignee': None,\n",
       "  'assignees': [],\n",
       "  'author_association': 'NONE',\n",
       "  'body': \"\\r\\n#### Problem description\\r\\n\\r\\nThe present implementation of `df.style.hide_index()` removes the complete index while rendering html. \\r\\nIt would be better to have an optional input of index level and hide only that index level while rendering.\\r\\nexample  `df.style.hide_index(level=1)`\\r\\nIt provides more option and flexibility to user. \\r\\n\\r\\n Sorry to post this as an issue, but I didn't find any option for suggesting new features.\\r\\n\",\n",
       "  'closed_at': None,\n",
       "  'comments': 8,\n",
       "  'comments_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25475/comments',\n",
       "  'created_at': '2019-02-28T12:49:55Z',\n",
       "  'events_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25475/events',\n",
       "  'html_url': 'https://github.com/pandas-dev/pandas/issues/25475',\n",
       "  'id': 415607854,\n",
       "  'labels': [{'color': 'fbca04',\n",
       "    'default': False,\n",
       "    'id': 195647922,\n",
       "    'name': 'Difficulty Intermediate',\n",
       "    'node_id': 'MDU6TGFiZWwxOTU2NDc5MjI=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Difficulty%20Intermediate'},\n",
       "   {'color': '006b75',\n",
       "    'default': False,\n",
       "    'id': 195648017,\n",
       "    'name': 'Effort Medium',\n",
       "    'node_id': 'MDU6TGFiZWwxOTU2NDgwMTc=',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Effort%20Medium'},\n",
       "   {'color': '006b75',\n",
       "    'default': False,\n",
       "    'id': 57395487,\n",
       "    'name': 'IO HTML',\n",
       "    'node_id': 'MDU6TGFiZWw1NzM5NTQ4Nw==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/IO%20HTML'},\n",
       "   {'color': '207de5',\n",
       "    'default': False,\n",
       "    'id': 71268330,\n",
       "    'name': 'MultiIndex',\n",
       "    'node_id': 'MDU6TGFiZWw3MTI2ODMzMA==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/MultiIndex'},\n",
       "   {'color': 'ededed',\n",
       "    'default': False,\n",
       "    'id': 13101118,\n",
       "    'name': 'Output-Formatting',\n",
       "    'node_id': 'MDU6TGFiZWwxMzEwMTExOA==',\n",
       "    'url': 'https://api.github.com/repos/pandas-dev/pandas/labels/Output-Formatting'}],\n",
       "  'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25475/labels{/name}',\n",
       "  'locked': False,\n",
       "  'milestone': {'closed_at': None,\n",
       "   'closed_issues': 367,\n",
       "   'created_at': '2015-01-13T10:53:19Z',\n",
       "   'creator': {'avatar_url': 'https://avatars2.githubusercontent.com/u/953992?v=4',\n",
       "    'events_url': 'https://api.github.com/users/jreback/events{/privacy}',\n",
       "    'followers_url': 'https://api.github.com/users/jreback/followers',\n",
       "    'following_url': 'https://api.github.com/users/jreback/following{/other_user}',\n",
       "    'gists_url': 'https://api.github.com/users/jreback/gists{/gist_id}',\n",
       "    'gravatar_id': '',\n",
       "    'html_url': 'https://github.com/jreback',\n",
       "    'id': 953992,\n",
       "    'login': 'jreback',\n",
       "    'node_id': 'MDQ6VXNlcjk1Mzk5Mg==',\n",
       "    'organizations_url': 'https://api.github.com/users/jreback/orgs',\n",
       "    'received_events_url': 'https://api.github.com/users/jreback/received_events',\n",
       "    'repos_url': 'https://api.github.com/users/jreback/repos',\n",
       "    'site_admin': False,\n",
       "    'starred_url': 'https://api.github.com/users/jreback/starred{/owner}{/repo}',\n",
       "    'subscriptions_url': 'https://api.github.com/users/jreback/subscriptions',\n",
       "    'type': 'User',\n",
       "    'url': 'https://api.github.com/users/jreback'},\n",
       "   'description': 'Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.',\n",
       "   'due_on': '2020-12-31T08:00:00Z',\n",
       "   'html_url': 'https://github.com/pandas-dev/pandas/milestone/32',\n",
       "   'id': 933188,\n",
       "   'labels_url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels',\n",
       "   'node_id': 'MDk6TWlsZXN0b25lOTMzMTg4',\n",
       "   'number': 32,\n",
       "   'open_issues': 1228,\n",
       "   'state': 'open',\n",
       "   'title': 'Contributions Welcome',\n",
       "   'updated_at': '2019-03-04T02:12:48Z',\n",
       "   'url': 'https://api.github.com/repos/pandas-dev/pandas/milestones/32'},\n",
       "  'node_id': 'MDU6SXNzdWU0MTU2MDc4NTQ=',\n",
       "  'number': 25475,\n",
       "  'repository_url': 'https://api.github.com/repos/pandas-dev/pandas',\n",
       "  'state': 'open',\n",
       "  'title': 'New Feature Request: df.style.hide_index() to hide a particular index level',\n",
       "  'updated_at': '2019-02-28T14:15:33Z',\n",
       "  'url': 'https://api.github.com/repos/pandas-dev/pandas/issues/25475',\n",
       "  'user': {'avatar_url': 'https://avatars3.githubusercontent.com/u/33785407?v=4',\n",
       "   'events_url': 'https://api.github.com/users/samcha1996/events{/privacy}',\n",
       "   'followers_url': 'https://api.github.com/users/samcha1996/followers',\n",
       "   'following_url': 'https://api.github.com/users/samcha1996/following{/other_user}',\n",
       "   'gists_url': 'https://api.github.com/users/samcha1996/gists{/gist_id}',\n",
       "   'gravatar_id': '',\n",
       "   'html_url': 'https://github.com/samcha1996',\n",
       "   'id': 33785407,\n",
       "   'login': 'samcha1996',\n",
       "   'node_id': 'MDQ6VXNlcjMzNzg1NDA3',\n",
       "   'organizations_url': 'https://api.github.com/users/samcha1996/orgs',\n",
       "   'received_events_url': 'https://api.github.com/users/samcha1996/received_events',\n",
       "   'repos_url': 'https://api.github.com/users/samcha1996/repos',\n",
       "   'site_admin': False,\n",
       "   'starred_url': 'https://api.github.com/users/samcha1996/starred{/owner}{/repo}',\n",
       "   'subscriptions_url': 'https://api.github.com/users/samcha1996/subscriptions',\n",
       "   'type': 'User',\n",
       "   'url': 'https://api.github.com/users/samcha1996'}}]"
      ]
     },
     "execution_count": 203,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 205,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'fix segfault when running with cython coverage enabled, xref cython#2879'"
      ]
     },
     "execution_count": 205,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[0]['title']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 207,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>number</th>\n",
       "      <th>title</th>\n",
       "      <th>labels</th>\n",
       "      <th>state</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25529</td>\n",
       "      <td>fix segfault when running with cython coverage...</td>\n",
       "      <td>[]</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>25528</td>\n",
       "      <td>DOC: Polishing typos out of doc/source/user_gu...</td>\n",
       "      <td>[]</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>25527</td>\n",
       "      <td>Data dependent bug in mode aggregation</td>\n",
       "      <td>[{'id': 307649777, 'node_id': 'MDU6TGFiZWwzMDc...</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>25526</td>\n",
       "      <td>DOC: Fixed PeriodArray api ref</td>\n",
       "      <td>[{'id': 134699, 'node_id': 'MDU6TGFiZWwxMzQ2OT...</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>25525</td>\n",
       "      <td>DOC: resolve all GL03 docstring validation errors</td>\n",
       "      <td>[{'id': 134699, 'node_id': 'MDU6TGFiZWwxMzQ2OT...</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>25488</td>\n",
       "      <td>Fix JSON orient='table' issues with numeric co...</td>\n",
       "      <td>[{'id': 49379259, 'node_id': 'MDU6TGFiZWw0OTM3...</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>25484</td>\n",
       "      <td>BUG: User-facing AssertionError with add colum...</td>\n",
       "      <td>[{'id': 42670965, 'node_id': 'MDU6TGFiZWw0MjY3...</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>25481</td>\n",
       "      <td>BUG: confusing error message for DataFrame.plot()</td>\n",
       "      <td>[{'id': 42670965, 'node_id': 'MDU6TGFiZWw0MjY3...</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>25476</td>\n",
       "      <td>value_counts() counting wrong categories</td>\n",
       "      <td>[]</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>25475</td>\n",
       "      <td>New Feature Request: df.style.hide_index() to ...</td>\n",
       "      <td>[{'id': 195647922, 'node_id': 'MDU6TGFiZWwxOTU...</td>\n",
       "      <td>open</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>30 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    number                                              title  \\\n",
       "0    25529  fix segfault when running with cython coverage...   \n",
       "1    25528  DOC: Polishing typos out of doc/source/user_gu...   \n",
       "2    25527             Data dependent bug in mode aggregation   \n",
       "3    25526                     DOC: Fixed PeriodArray api ref   \n",
       "4    25525  DOC: resolve all GL03 docstring validation errors   \n",
       "..     ...                                                ...   \n",
       "25   25488  Fix JSON orient='table' issues with numeric co...   \n",
       "26   25484  BUG: User-facing AssertionError with add colum...   \n",
       "27   25481  BUG: confusing error message for DataFrame.plot()   \n",
       "28   25476           value_counts() counting wrong categories   \n",
       "29   25475  New Feature Request: df.style.hide_index() to ...   \n",
       "\n",
       "                                               labels state  \n",
       "0                                                  []  open  \n",
       "1                                                  []  open  \n",
       "2   [{'id': 307649777, 'node_id': 'MDU6TGFiZWwzMDc...  open  \n",
       "3   [{'id': 134699, 'node_id': 'MDU6TGFiZWwxMzQ2OT...  open  \n",
       "4   [{'id': 134699, 'node_id': 'MDU6TGFiZWwxMzQ2OT...  open  \n",
       "..                                                ...   ...  \n",
       "25  [{'id': 49379259, 'node_id': 'MDU6TGFiZWw0OTM3...  open  \n",
       "26  [{'id': 42670965, 'node_id': 'MDU6TGFiZWw0MjY3...  open  \n",
       "27  [{'id': 42670965, 'node_id': 'MDU6TGFiZWw0MjY3...  open  \n",
       "28                                                 []  open  \n",
       "29  [{'id': 195647922, 'node_id': 'MDU6TGFiZWwxOTU...  open  \n",
       "\n",
       "[30 rows x 4 columns]"
      ]
     },
     "execution_count": 207,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame(data, columns=['number', 'title','labels', 'state'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 208,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sqlite3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "metadata": {},
   "outputs": [],
   "source": [
    "query = \"\"\"\n",
    "CREATE TABLE test\n",
    "(a VARCHAR(20), b VARCHAR(20),\n",
    "c REAL, d INTEGER\n",
    ");\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 210,
   "metadata": {},
   "outputs": [],
   "source": [
    "con = sqlite3.connect('mydata.sqlite')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 211,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<sqlite3.Cursor at 0x1f67531af80>"
      ]
     },
     "execution_count": 211,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "con.execute(query)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 212,
   "metadata": {},
   "outputs": [],
   "source": [
    "con.commit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = [('Atlanta', 'Georgia', 1.25, 6),\n",
    "('Tallahassee', 'Florida', 2.6, 3),\n",
    "('Sacramento', 'California', 1.7, 5)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 214,
   "metadata": {},
   "outputs": [],
   "source": [
    "stmt = \"INSERT INTO TEST VALUES (?,?,?,?)\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 215,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<sqlite3.Cursor at 0x1f675307a40>"
      ]
     },
     "execution_count": 215,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "con.executemany(stmt,data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 216,
   "metadata": {},
   "outputs": [],
   "source": [
    "con.commit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 217,
   "metadata": {},
   "outputs": [],
   "source": [
    " cursor = con.execute('select * from test')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 218,
   "metadata": {},
   "outputs": [],
   "source": [
    "rows = cursor.fetchall()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 219,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Atlanta', 'Georgia', 1.25, 6),\n",
       " ('Tallahassee', 'Florida', 2.6, 3),\n",
       " ('Sacramento', 'California', 1.7, 5)]"
      ]
     },
     "execution_count": 219,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rows"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 220,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(('a', None, None, None, None, None, None),\n",
       " ('b', None, None, None, None, None, None),\n",
       " ('c', None, None, None, None, None, None),\n",
       " ('d', None, None, None, None, None, None))"
      ]
     },
     "execution_count": 220,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " cursor.description"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 221,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Atlanta</td>\n",
       "      <td>Georgia</td>\n",
       "      <td>1.25</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tallahassee</td>\n",
       "      <td>Florida</td>\n",
       "      <td>2.60</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Sacramento</td>\n",
       "      <td>California</td>\n",
       "      <td>1.70</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             a           b     c  d\n",
       "0      Atlanta     Georgia  1.25  6\n",
       "1  Tallahassee     Florida  2.60  3\n",
       "2   Sacramento  California  1.70  5"
      ]
     },
     "execution_count": 221,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame(rows, columns=[x[0] for x in cursor.description])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 222,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sqlalchemy as sqla"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 223,
   "metadata": {},
   "outputs": [],
   "source": [
    "db = sqla.create_engine('sqlite:///mydata.sqlite')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 224,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "      <th>d</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Atlanta</td>\n",
       "      <td>Georgia</td>\n",
       "      <td>1.25</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Tallahassee</td>\n",
       "      <td>Florida</td>\n",
       "      <td>2.60</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Sacramento</td>\n",
       "      <td>California</td>\n",
       "      <td>1.70</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             a           b     c  d\n",
       "0      Atlanta     Georgia  1.25  6\n",
       "1  Tallahassee     Florida  2.60  3\n",
       "2   Sacramento  California  1.70  5"
      ]
     },
     "execution_count": 224,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_sql('select * from test',db)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
